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