OLD | NEW |
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 Loading... |
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 Loading... |
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); |
OLD | NEW |