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

Side by Side Diff: chrome/test/data/extensions/api_test/wallpaper_manager/test.js

Issue 12334030: New custom wallpaper picker UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add bug reference Created 7 years, 9 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
« no previous file with comments | « chrome/common/extensions/api/wallpaper_private.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // wallpaperPrivate api test 5 // wallpaperPrivate api test
6 // browser_tests --gtest_filter=ExtensionApiTest.wallpaperPrivate 6 // browser_tests --gtest_filter=ExtensionApiTest.wallpaperPrivate
7 7
8 var pass = chrome.test.callbackPass; 8 var pass = chrome.test.callbackPass;
9 var fail = chrome.test.callbackFail; 9 var fail = chrome.test.callbackFail;
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 fail('Only custom wallpaper can change layout.')); 46 fail('Only custom wallpaper can change layout.'));
47 })); 47 }));
48 } else { 48 } else {
49 chrome.test.fail('Failed to load test.jpg from local server.'); 49 chrome.test.fail('Failed to load test.jpg from local server.');
50 } 50 }
51 }); 51 });
52 }, 52 },
53 function setCustomJpegWallpaper() { 53 function setCustomJpegWallpaper() {
54 chrome.wallpaperPrivate.setCustomWallpaper(wallpaper, 54 chrome.wallpaperPrivate.setCustomWallpaper(wallpaper,
55 'CENTER_CROPPED', 55 'CENTER_CROPPED',
56 pass(function(fileName) { 56 true,
57 '123',
58 pass(function(thumbnail) {
57 chrome.wallpaperPrivate.setCustomWallpaperLayout('CENTER', 59 chrome.wallpaperPrivate.setCustomWallpaperLayout('CENTER',
58 pass(function() { 60 pass(function() {
59 chrome.wallpaperPrivate.setCustomWallpaperLayout('STRETCH', pass()); 61 chrome.wallpaperPrivate.setCustomWallpaperLayout('STRETCH', pass());
60 })); 62 }));
61 })); 63 }));
62 }, 64 },
63 function getCustomWallpaperThumbnail() { 65 function getCustomWallpaperThumbnail() {
64 chrome.wallpaperPrivate.getOfflineWallpaperList('CUSTOM', 66 chrome.wallpaperPrivate.getOfflineWallpaperList('CUSTOM',
65 pass(function(lists) { 67 pass(function(lists) {
66 chrome.test.assertEq(1, lists.length); 68 chrome.test.assertEq(1, lists.length);
67 chrome.wallpaperPrivate.getThumbnail(lists[0], 'CUSTOM', 69 chrome.wallpaperPrivate.getThumbnail(lists[0], 'CUSTOM',
68 pass(function(data) { 70 pass(function(data) {
69 chrome.test.assertNoLastError(); 71 chrome.test.assertNoLastError();
70 })); 72 }));
71 })); 73 }));
72 }, 74 },
73 function setCustomJepgBadWallpaper() { 75 function setCustomJepgBadWallpaper() {
74 var url = "http://a.com:PORT/files/extensions/api_test" + 76 var url = "http://a.com:PORT/files/extensions/api_test" +
75 "/wallpaper_manager/test_bad.jpg"; 77 "/wallpaper_manager/test_bad.jpg";
76 url = url.replace(/PORT/, config.testServer.port); 78 url = url.replace(/PORT/, config.testServer.port);
77 requestImage(url, function(requestStatus, response) { 79 requestImage(url, function(requestStatus, response) {
78 if (requestStatus === 200) { 80 if (requestStatus === 200) {
79 var badWallpaper = response; 81 var badWallpaper = response;
80 chrome.wallpaperPrivate.setCustomWallpaper(badWallpaper, 82 chrome.wallpaperPrivate.setCustomWallpaper(badWallpaper,
81 'CENTER_CROPPED', fail(wallpaperStrings.invalidWallpaper)); 83 'CENTER_CROPPED', false, '123',
84 fail(wallpaperStrings.invalidWallpaper));
82 } else { 85 } else {
83 chrome.test.fail('Failed to load test_bad.jpg from local server.'); 86 chrome.test.fail('Failed to load test_bad.jpg from local server.');
84 } 87 }
85 }); 88 });
86 }, 89 },
87 function setWallpaperFromFileSystem() { 90 function setWallpaperFromFileSystem() {
88 var url = "http://a.com:PORT/files/extensions/api_test" + 91 var url = "http://a.com:PORT/files/extensions/api_test" +
89 "/wallpaper_manager/test.jpg"; 92 "/wallpaper_manager/test.jpg";
90 url = url.replace(/PORT/, config.testServer.port); 93 url = url.replace(/PORT/, config.testServer.port);
91 chrome.wallpaperPrivate.setWallpaperIfExist(url, 'CENTER_CROPPED', 94 chrome.wallpaperPrivate.setWallpaperIfExist(url, 'CENTER_CROPPED',
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 chrome.wallpaperPrivate.getOfflineWallpaperList('ONLINE', 134 chrome.wallpaperPrivate.getOfflineWallpaperList('ONLINE',
132 pass(function(list) { 135 pass(function(list) {
133 chrome.test.assertEq('test.jpg', list[0]); 136 chrome.test.assertEq('test.jpg', list[0]);
134 chrome.test.assertEq('test1.jpg', list[1]); 137 chrome.test.assertEq('test1.jpg', list[1]);
135 })); 138 }));
136 })); 139 }));
137 })); 140 }));
138 } 141 }
139 ]); 142 ]);
140 }); 143 });
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/wallpaper_private.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698