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

Side by Side Diff: chrome/test/data/chromeos/wallpaper_manager/unit_tests/api_mock.js

Issue 956403003: Fix the issue that wallpaper changes twice when both "onChanged" and "onAlarm" are fired. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the failed wallpaper sync test. Created 5 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
« no previous file with comments | « chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 5
6 var TestConstants = { 6 var TestConstants = {
7 wallpaperURL: 'https://test.com/test.jpg', 7 wallpaperURL: 'https://test.com/test.jpg',
8 // A dummy string which is used to mock an image. 8 // A dummy string which is used to mock an image.
9 IMAGE: '*#*@#&', 9 IMAGE: '*#*@#&',
10 // A dummy array which is used to mock the file content. 10 // A dummy array which is used to mock the file content.
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 'source': Constants.WallpaperSourceEnum.Custom 208 'source': Constants.WallpaperSourceEnum.Custom
209 }; 209 };
210 } 210 }
211 callback(items); 211 callback(items);
212 }, 212 },
213 set: function(items, callback) { 213 set: function(items, callback) {
214 } 214 }
215 }, 215 },
216 sync: { 216 sync: {
217 get: function(key, callback) { 217 get: function(key, callback) {
218 var items = {};
219 switch (key) {
220 case Constants.AccessSurpriseMeEnabledKey:
221 items[Constants.AccessSurpriseMeEnabledKey] = true;
222 case Constants.AccessLastSurpriseWallpaperChangedDate:
223 items[Constants.AccessLastSurpriseWallpaperChangedDate] =
224 new Date().toDateString();
225 }
226 callback(items);
218 }, 227 },
219 set: function(items, callback) { 228 set: function(items, callback) {
220 } 229 }
221 }, 230 },
222 onChanged: { 231 onChanged: {
223 addListener: function(listener) { 232 addListener: function(listener) {
224 this.dispatch = listener; 233 this.dispatch = listener;
225 } 234 }
226 } 235 }
227 }, 236 },
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 }; 328 };
320 329
321 function uninstallMockXMLHttpRequest() { 330 function uninstallMockXMLHttpRequest() {
322 window['XMLHttpRequest'] = originalXMLHttpRequest; 331 window['XMLHttpRequest'] = originalXMLHttpRequest;
323 }; 332 };
324 333
325 exports.installMockXMLHttpRequest = installMockXMLHttpRequest; 334 exports.installMockXMLHttpRequest = installMockXMLHttpRequest;
326 exports.uninstallMockXMLHttpRequest = uninstallMockXMLHttpRequest; 335 exports.uninstallMockXMLHttpRequest = uninstallMockXMLHttpRequest;
327 336
328 })(window); 337 })(window);
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/wallpaper_manager/js/wallpaper_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698