Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chrome/test/data/extensions/api_test/icons/extension_with_permission/index.js

Issue 10826157: Check for warnings when loading extensions in browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ExtensionTerminalPrivateApiTest.TerminalTest Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 var TEST_CASES = [
2 // Tests loading a standard 128px icon.
3 {
4 url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/128/0',
5 expectedSize: 128
6 },
7 // Tests loading a standard 48px icon with a MATCH_SMALLER.
8 // This should not be resized to 48px.
9 {
10 url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/48/2',
11 expectedSize: 32
12 },
13 // Tests loading a standard 32px icon, grayscale. We assume that we actually
14 // got a grayscale image back here.
15 {
16 url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/' +
17 '32/1?grayscale=true',
18 expectedSize: 32
19 },
20 // Tests loading a 16px by resizing the 32px version (MATCH_BIGGER).
21 // This should be resized to 16px.
22 {
23 url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/16/1',
24 expectedSize: 16
25 }
26 ];
27
28 var loadedImageCount = 0;
29
30 TEST_CASES.forEach(function(testCase) {
31 var img = document.createElement('img');
32 img.onload = function() {
33 if (img.naturalWidth != testCase.expectedSize ||
34 img.naturalHeight != testCase.expectedSize) {
35 document.title = 'Incorrect size on ' + testCase.url +
36 ' Expected: ' + testCase.expectedSize + 'x' + testCase.expectedSize +
37 ' Actual: ' + img.naturalWidth + 'x' + img.naturalHeight;
38 return;
39 }
40
41 if (++loadedImageCount == TEST_CASES.length) {
42 document.title = 'Loaded';
43 }
44 };
45 img.onerror = function() {
46 // We failed to load an image that should have loaded.
47 document.title = 'Couldn\'t load ' + testCase.url;
48 };
49 img.src = testCase.url;
50 document.body.appendChild(img);
51 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698