|
14 | 14 |
|
15 | 15 | var logger = function (str, level) {
|
16 | 16 | var levelClass = '';
|
17 |
| - if (level == LOG_LEVEL_INFO) { levelClass = 'info' } ; |
18 |
| - if (level == LOG_LEVEL_WARNING) { levelClass = 'warn' }; |
19 |
| - if (level == LOG_LEVEL_ERROR) { levelClass = 'error' }; |
| 17 | + if (level == LOG_LEVEL_INFO) { levelClass = 'info' } ; |
| 18 | + if (level == LOG_LEVEL_WARNING) { levelClass = 'warn' }; |
| 19 | + if (level == LOG_LEVEL_ERROR) { levelClass = 'error' }; |
20 | 20 | $('#log').append($('<li></li>').addClass(levelClass).text(str));
|
21 | 21 | };
|
22 | 22 |
|
|
35 | 35 | var testedMethods = {};
|
36 | 36 |
|
37 | 37 | ImgCache.options.debug = true;
|
38 |
| - ImgCache.options.customLogger = logger; |
| 38 | + ImgCache.overridables.log = logger; |
39 | 39 | ImgCache.options.cacheClearSize = 10;
|
40 | 40 | var default_options = ImgCache.options;
|
41 | 41 |
|
|
108 | 108 | name: 'getCachedFile',
|
109 | 109 | test: function (ok, nok) {
|
110 | 110 | // expected result: failure
|
111 |
| - ImgCache.getCachedFile($test_img.attr('src'), function (src, file_entry) { if (file_entry) { nok(); } else { ok(); } }); |
| 111 | + ImgCache.getCachedFile($test_img.attr('src'), function (src, file_entry) { if (file_entry) { nok(); } else { ok(); } }); |
112 | 112 | }
|
113 | 113 | },
|
114 | 114 | {
|
|
128 | 128 | test: function (ok, nok) {
|
129 | 129 | var img_src = getBackgroundImageUrl($test_div);
|
130 | 130 | if (img_src) {
|
131 |
| - ImgCache.isCached(img_src, function (src, res) { if (res) { ok(); } else { nok(); } }); |
| 131 | + ImgCache.isCached(img_src, function (src, res) { if (res) { ok(); } else { nok(); } }); |
132 | 132 | } else {
|
133 | 133 | nok();
|
134 | 134 | }
|
|
147 | 147 | nok();
|
148 | 148 | }
|
149 | 149 | });
|
150 |
| - } else { |
| 150 | + } else { |
151 | 151 | nok();
|
152 | 152 | }
|
153 | 153 | }
|
|
314 | 314 |
|
315 | 315 | var countTestedMethods = 0;
|
316 | 316 | for (var key in testedMethods) {
|
317 |
| - if (testedMethods.hasOwnProperty(key)) { countTestedMethods++ }; |
| 317 | + if (testedMethods.hasOwnProperty(key)) { countTestedMethods++ }; |
318 | 318 | }
|
319 | 319 |
|
320 | 320 | var coverage = 'API coverage: ' + countTestedMethods + '/' + countTotalMethods;
|
|
323 | 323 | for (var i = 0; i < testableMethods.length; i++) {
|
324 | 324 | var method = testableMethods[i];
|
325 | 325 | if (!testedMethods.hasOwnProperty(method)) {
|
326 |
| - if (untestedMethods.length > 0) { |
| 326 | + if (untestedMethods.length > 0) { |
327 | 327 | untestedMethods += ' / ';
|
328 | 328 | }
|
329 | 329 | untestedMethods += method;
|
|
0 commit comments