Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / google_now / cards_unittest.gtestjs
index 032b72d..a55a91d 100644 (file)
@@ -16,6 +16,7 @@ GoogleNowCardsUnitTest.prototype = {
 
   /** @override */
   extraLibraries: [
+    'common_test_util.js',
     'cards.js'
   ]
 };
@@ -43,8 +44,8 @@ var testActionUrlsA = {testField: 'TEST VALUE A'};
 var testActionUrlsB = {testField: 'TEST VALUE B'};
 var testDismissalA = {testDismissalField: 'TEST DISMISSAL VALUE A'};
 var testDismissalB = {testDismissalField: 'TEST DISMISSAL VALUE B'};
-var LOCATION_CARDS_LINK_THRESHOLD = 10;
-var localStorage = {locationCardsShown: 0};
+var EXPLANATORY_CARDS_LINK_THRESHOLD = 4;
+var localStorage = {explanatoryCardsShown: 0};
 var notificationUpdateSuccessful = true;
 var notificationUpdateFailed = false;
 
@@ -54,7 +55,7 @@ function setUpCardManagerTest(fixture) {
       'chrome.alarms.create',
       'instrumented.notifications.clear',
       'chrome.storage.local.set',
-      'countLocationCard',
+      'countExplanatoryCard',
       'instrumented.alarms.onAlarm.addListener',
       'instrumented.notifications.create',
       'instrumented.notifications.update',
@@ -118,7 +119,7 @@ TEST_F('GoogleNowCardsUnitTest', 'UpdateSimpleHideFuture', function() {
           chromeNotificationsUpdateSavedArgs.match(ANYTHING)).
       will(invokeCallback(
           chromeNotificationsUpdateSavedArgs, 2, notificationUpdateSuccessful));
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       chrome_alarms_create(expectedAlarmId, eqJSON({when: 300001}));
 
   // Call tested method.
@@ -178,7 +179,7 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateSimpleHideFuture', function() {
   this.mockLocalFunctions.expects(once()).
       onCardShown(eqJSON(testUncombinedNotification.receivedNotification));
 
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       chrome_alarms_create(expectedAlarmId, eqJSON({when: 300001}));
 
   // Call tested method.
@@ -220,9 +221,9 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateSimpleShowFuture', function() {
 
   this.mockApis.expects(once()).
       chrome_alarms_clear(expectedAlarmId);
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       instrumented_notifications_clear(testCardId, ANYTHING);
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       chrome_alarms_create(expectedAlarmId, eqJSON({when: 300001}));
 
   // Call tested method.
@@ -258,7 +259,7 @@ TEST_F('GoogleNowCardsUnitTest', 'UpdateSimpleHidePast', function() {
   var test = setUpCardManagerTest(this);
   this.mockApis.expects(once()).
       chrome_alarms_clear(expectedAlarmId);
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       instrumented_notifications_clear(testCardId, ANYTHING);
 
   var groups = {
@@ -330,7 +331,7 @@ TEST_F('GoogleNowCardsUnitTest', 'UpdateComplex', function() {
           chromeNotificationsUpdateSavedArgs.match(ANYTHING)).
       will(invokeCallback(
           chromeNotificationsUpdateSavedArgs, 2, notificationUpdateSuccessful));
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       chrome_alarms_create(expectedAlarmId, eqJSON({when: 300001}));
 
   // Call tested method.
@@ -370,7 +371,7 @@ TEST_F('GoogleNowCardsUnitTest', 'DismissSimple', function() {
   var test = setUpCardManagerTest(this);
   this.mockApis.expects(once()).
       chrome_alarms_clear(expectedAlarmId);
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       instrumented_notifications_clear(testCardId, ANYTHING);
 
   var groups = {
@@ -450,9 +451,9 @@ TEST_F('GoogleNowCardsUnitTest', 'DismissComplex', function() {
   var test = setUpCardManagerTest(this);
   this.mockApis.expects(once()).
       chrome_alarms_clear(expectedAlarmId);
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       instrumented_notifications_clear(testCardId, ANYTHING);
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       chrome_alarms_create(expectedAlarmId, eqJSON({when: 300010}));
 
   // Call tested method.
@@ -610,7 +611,7 @@ TEST_F('GoogleNowCardsUnitTest', 'onAlarmUpdate', function() {
           chromeNotificationsUpdateSavedArgs.match(ANYTHING)).
       will(invokeCallback(
           chromeNotificationsUpdateSavedArgs, 2, notificationUpdateSuccessful));
-  this.mockApis.expects(once()).       
+  this.mockApis.expects(once()).
       chrome_alarms_create(expectedAlarmId, eqJSON({when: 300001}));
   this.mockApis.expects(once()).
       chrome_storage_local_set(eqJSON({