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

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

Issue 621693002: Revert of Unit test for sync online wallpaper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 'use strict';
5
6 var mockController;
7
8 function setUp() {
9 mockController = new MockController();
10 installMockXMLHttpRequest();
11 }
12
13 function tearDown() {
14 mockController.verifyMocks();
15 mockController.reset();
16 uninstallMockXMLHttpRequest();
17 }
18
19 // Test sync online wallpaper. When the synced wallpaper info is not the same as
20 // the local wallpaper info, wallpaper should set to the synced one.
21 function testSyncOnlineWallpaper() {
22 // Setup sync value.
23 var changes = {};
24 changes[Constants.AccessSyncWallpaperInfoKey] = {};
25 changes[Constants.AccessSyncWallpaperInfoKey].newValue = {
26 'url': TestConstants.wallpaperURL,
27 'layout': 'custom',
28 'source': Constants.WallpaperSourceEnum.Online
29 };
30
31 chrome.wallpaperPrivate = {};
32 var mockSetWallpaperIfExists = mockController.createFunctionMock(
33 chrome.wallpaperPrivate, 'setWallpaperIfExists');
34 mockSetWallpaperIfExists.addExpectation(
35 changes[Constants.AccessSyncWallpaperInfoKey].newValue.url,
36 changes[Constants.AccessSyncWallpaperInfoKey].newValue.layout);
37 mockSetWallpaperIfExists.callbackData = [false];
38
39 var mockSetWallpaper = mockController.createFunctionMock(
40 chrome.wallpaperPrivate, 'setWallpaper');
41 mockSetWallpaper.addExpectation(
42 TestConstants.image,
43 changes[Constants.AccessSyncWallpaperInfoKey].newValue.layout,
44 changes[Constants.AccessSyncWallpaperInfoKey].newValue.url);
45
46 chrome.storage.onChanged.dispatch(changes);
47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698