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

Side by Side Diff: chrome/browser/resources/google_now/background_unittest.gtestjs

Issue 53823002: Using “is opted in” server request (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rgustafson's comments Created 7 years, 1 month 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/browser/resources/google_now/background.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // TODO(robliao,vadimt): Determine the granularity of testing to perform. 5 // TODO(robliao,vadimt): Determine the granularity of testing to perform.
6 6
7 /** 7 /**
8 * Test fixture for background.js. 8 * Test fixture for background.js.
9 * @constructor 9 * @constructor
10 * @extends {testing.Test} 10 * @extends {testing.Test}
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 var storageGetSavedArgs = new SaveMockArguments(); 426 var storageGetSavedArgs = new SaveMockArguments();
427 this.mockApis.expects(once()). 427 this.mockApis.expects(once()).
428 instrumented_storage_local_get( 428 instrumented_storage_local_get(
429 storageGetSavedArgs.match(eq('notificationGroups')), 429 storageGetSavedArgs.match(eq('notificationGroups')),
430 storageGetSavedArgs.match(ANYTHING)). 430 storageGetSavedArgs.match(ANYTHING)).
431 will(invokeCallback( 431 will(invokeCallback(
432 storageGetSavedArgs, 1, {notificationGroups: storedGroups})); 432 storageGetSavedArgs, 1, {notificationGroups: storedGroups}));
433 433
434 this.mockGlobals.expects(once()). 434 this.mockGlobals.expects(once()).
435 scheduleNextPoll(eqJSON(expectedUpdatedGroups)); 435 scheduleNextPoll(eqJSON(expectedUpdatedGroups), true);
436 436
437 this.mockApis.expects(once()). 437 this.mockApis.expects(once()).
438 chrome_storage_local_set( 438 chrome_storage_local_set(
439 eqJSON({notificationGroups: expectedUpdatedGroups})); 439 eqJSON({notificationGroups: expectedUpdatedGroups}));
440 440
441 this.mockGlobals.expects(once()). 441 this.mockGlobals.expects(once()).
442 mergeAndShowNotificationCards(eqJSON(expectedUpdatedGroups)); 442 mergeAndShowNotificationCards(eqJSON(expectedUpdatedGroups));
443 443
444 this.mockGlobals.expects(once()). 444 this.mockGlobals.expects(once()).
445 recordEvent(GoogleNowEvent.CARDS_PARSE_SUCCESS); 445 recordEvent(GoogleNowEvent.CARDS_PARSE_SUCCESS);
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 chromeTabsCreateSavedArgs.match(eqJSON({url: testActionUrl})), 847 chromeTabsCreateSavedArgs.match(eqJSON({url: testActionUrl})),
848 chromeTabsCreateSavedArgs.match(ANYTHING)). 848 chromeTabsCreateSavedArgs.match(ANYTHING)).
849 will(invokeCallback(chromeTabsCreateSavedArgs, 1, testCreatedTab)); 849 will(invokeCallback(chromeTabsCreateSavedArgs, 1, testCreatedTab));
850 this.mockApis.expects(once()).chrome_windows_create( 850 this.mockApis.expects(once()).chrome_windows_create(
851 eqJSON({url: testActionUrl, focused: true})); 851 eqJSON({url: testActionUrl, focused: true}));
852 852
853 // Invoking the tested function. 853 // Invoking the tested function.
854 onNotificationClicked( 854 onNotificationClicked(
855 testNotificationId, this.mockLocalFunctions.functions().selector); 855 testNotificationId, this.mockLocalFunctions.functions().selector);
856 }); 856 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698