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

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

Issue 154653003: Count All Cards for Explanatory Link Support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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 /** 5 /**
6 * Test fixture for cards.js. 6 * Test fixture for cards.js.
7 * @constructor 7 * @constructor
8 * @extends {testing.Test} 8 * @extends {testing.Test}
9 */ 9 */
10 function GoogleNowCardsUnitTest () { 10 function GoogleNowCardsUnitTest () {
(...skipping 26 matching lines...) Expand all
37 testNotificationField: 'TEST NOTIFICATION VALUE B', 37 testNotificationField: 'TEST NOTIFICATION VALUE B',
38 priority: 2 38 priority: 2
39 }; 39 };
40 var groupNameA = 'A'; 40 var groupNameA = 'A';
41 var groupNameB = 'B'; 41 var groupNameB = 'B';
42 var expectedAlarmId = 'card-TEST CARD ID'; 42 var expectedAlarmId = 'card-TEST CARD ID';
43 var testActionUrlsA = {testField: 'TEST VALUE A'}; 43 var testActionUrlsA = {testField: 'TEST VALUE A'};
44 var testActionUrlsB = {testField: 'TEST VALUE B'}; 44 var testActionUrlsB = {testField: 'TEST VALUE B'};
45 var testDismissalA = {testDismissalField: 'TEST DISMISSAL VALUE A'}; 45 var testDismissalA = {testDismissalField: 'TEST DISMISSAL VALUE A'};
46 var testDismissalB = {testDismissalField: 'TEST DISMISSAL VALUE B'}; 46 var testDismissalB = {testDismissalField: 'TEST DISMISSAL VALUE B'};
47 var LOCATION_CARDS_LINK_THRESHOLD = 10; 47 var EXPLANATORY_CARDS_LINK_THRESHOLD = 4;
48 var localStorage = {locationCardsShown: 0}; 48 var localStorage = {explanatoryCardsShown: 0};
49 var notificationUpdateSuccessful = true; 49 var notificationUpdateSuccessful = true;
50 var notificationUpdateFailed = false; 50 var notificationUpdateFailed = false;
51 51
52 function setUpCardManagerTest(fixture) { 52 function setUpCardManagerTest(fixture) {
53 fixture.makeAndRegisterMockApis([ 53 fixture.makeAndRegisterMockApis([
54 'chrome.alarms.clear', 54 'chrome.alarms.clear',
55 'chrome.alarms.create', 55 'chrome.alarms.create',
56 'instrumented.notifications.clear', 56 'instrumented.notifications.clear',
57 'chrome.storage.local.set', 57 'chrome.storage.local.set',
58 'countLocationCard', 58 'countExplanatoryCard',
59 'instrumented.alarms.onAlarm.addListener', 59 'instrumented.alarms.onAlarm.addListener',
60 'instrumented.notifications.create', 60 'instrumented.notifications.create',
61 'instrumented.notifications.update', 61 'instrumented.notifications.update',
62 'instrumented.storage.local.get', 62 'instrumented.storage.local.get',
63 'tasks.add' 63 'tasks.add'
64 ]); 64 ]);
65 65
66 chrome.runtime = {}; // No error. 66 chrome.runtime = {}; // No error.
67 67
68 var onAlarmSavedArgs = new SaveMockArguments(); 68 var onAlarmSavedArgs = new SaveMockArguments();
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 timestamp: 300000, 621 timestamp: 300000,
622 combinedCard: [testUncombinedNotification] 622 combinedCard: [testUncombinedNotification]
623 } 623 }
624 }, 624 },
625 notificationGroups: { 625 notificationGroups: {
626 }})); 626 }}));
627 627
628 // Call tested method. 628 // Call tested method.
629 test.alarmCallback({name: expectedAlarmId}); 629 test.alarmCallback({name: expectedAlarmId});
630 }); 630 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/google_now/cards.js ('k') | chrome/browser/resources/google_now/utility.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698