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

Unified Diff: chrome/browser/resources/google_now/cards_unittest.gtestjs

Issue 22647003: Remove chrome.* Function Instrumentation Inlining and Use a Separate Instrumented Object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SMLog
Patch Set: Quick Spacing Fix Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/cards_unittest.gtestjs
diff --git a/chrome/browser/resources/google_now/cards_unittest.gtestjs b/chrome/browser/resources/google_now/cards_unittest.gtestjs
index 01cb7894cb705d514ed2f92372f88d98cdd2add1..50375c488c0ec55e4863f00b9c2682c2e453f085 100644
--- a/chrome/browser/resources/google_now/cards_unittest.gtestjs
+++ b/chrome/browser/resources/google_now/cards_unittest.gtestjs
@@ -29,20 +29,20 @@ var testDismissal = {testDismissalField: 'TEST DISMISSAL VALUE'};
function setUpCardManagerTest(fixture) {
fixture.makeAndRegisterMockApis([
- 'chrome.alarms.onAlarm.addListener',
'chrome.alarms.clear',
'chrome.alarms.create',
'chrome.notifications.clear',
- 'chrome.notifications.create',
- 'chrome.notifications.update',
- 'storage.get'
+ 'instrumented.alarms.onAlarm.addListener',
+ 'instrumented.notifications.create',
+ 'instrumented.notifications.update',
+ 'instrumented.storage.local.get'
]);
chrome.runtime = {}; // No error.
var onAlarmSavedArgs = new SaveMockArguments();
fixture.mockApis.expects(once()).
- chrome_alarms_onAlarm_addListener(
+ instrumented_alarms_onAlarm_addListener(
onAlarmSavedArgs.match(ANYTHING));
var cardSet = buildCardSet();
@@ -78,7 +78,7 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateCard', function() {
chrome_alarms_clear(expectedShowAlarmId);
var chromeNotificationsCreateSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- chrome_notifications_create(
+ instrumented_notifications_create(
chromeNotificationsCreateSavedArgs.match(eq(testCardId)),
chromeNotificationsCreateSavedArgs.match(eqJSON(testNotification)),
chromeNotificationsCreateSavedArgs.match(ANYTHING)).
@@ -101,7 +101,7 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateCard', function() {
timeHide: undefined,
version: 0
},
- dismissalParameters: testDismissal
+ dismissalParameters: testDismissal
}),
JSON.stringify(notificationData));
});
@@ -116,7 +116,7 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateCardEmptyTrigger', function() {
this.mockApis.expects(once()).
chrome_alarms_clear(expectedShowAlarmId);
this.mockApis.expects(once()).
- chrome_notifications_create(
+ instrumented_notifications_create(
testCardId, eqJSON(testNotification), ANYTHING);
// Call tested method.
@@ -153,7 +153,7 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateCardHideTime', function() {
chrome_alarms_clear(expectedShowAlarmId);
var chromeNotificationsCreateSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- chrome_notifications_create(
+ instrumented_notifications_create(
chromeNotificationsCreateSavedArgs.match(eq(testCardId)),
chromeNotificationsCreateSavedArgs.match(eqJSON(testNotification)),
chromeNotificationsCreateSavedArgs.match(ANYTHING)).
@@ -195,7 +195,7 @@ TEST_F('GoogleNowCardsUnitTest', 'UpdateCardSameVersion', function() {
chrome_alarms_clear(expectedShowAlarmId);
var chromeNotificationsCreateSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- chrome_notifications_update(
+ instrumented_notifications_update(
chromeNotificationsCreateSavedArgs.match(eq(testCardId)),
chromeNotificationsCreateSavedArgs.match(eqJSON(testNotification)),
chromeNotificationsCreateSavedArgs.match(ANYTHING)).
@@ -236,7 +236,7 @@ TEST_F('GoogleNowCardsUnitTest', 'UpdateCardSameVersionHideTime', function() {
chrome_alarms_clear(expectedShowAlarmId);
var chromeNotificationsCreateSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- chrome_notifications_update(
+ instrumented_notifications_update(
chromeNotificationsCreateSavedArgs.match(eq(testCardId)),
chromeNotificationsCreateSavedArgs.match(eqJSON(testNotification)),
chromeNotificationsCreateSavedArgs.match(ANYTHING)).
@@ -265,7 +265,7 @@ TEST_F('GoogleNowCardsUnitTest', 'UpdateCardDifferentVersion', function() {
this.mockApis.expects(once()).
chrome_alarms_clear(expectedShowAlarmId);
this.mockApis.expects(once()).
- chrome_notifications_create(
+ instrumented_notifications_create(
testCardId, eqJSON(testNotification), ANYTHING);
// Call tested method.
@@ -288,7 +288,7 @@ TEST_F('GoogleNowCardsUnitTest', 'CreateCardTriggerShowNow', function() {
this.mockApis.expects(once()).
chrome_alarms_clear(expectedShowAlarmId);
this.mockApis.expects(once()).
- chrome_notifications_create(
+ instrumented_notifications_create(
testCardId, eqJSON(testNotification), ANYTHING);
// Call tested method.
@@ -351,7 +351,7 @@ TEST_F('GoogleNowCardsUnitTest', 'onAlarmShowNoData', function() {
var test = setUpCardManagerTest(this);
var storageGetSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- storage_get(
+ instrumented_storage_local_get(
storageGetSavedArgs.match(eq('notificationsData')),
storageGetSavedArgs.match(ANYTHING)).
will(invokeCallback(storageGetSavedArgs, 1, {}));
@@ -366,7 +366,7 @@ TEST_F('GoogleNowCardsUnitTest', 'onAlarmShowHasDataCreate', function() {
var test = setUpCardManagerTest(this);
var storageGetSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- storage_get(
+ instrumented_storage_local_get(
storageGetSavedArgs.match(eq('notificationsData')),
storageGetSavedArgs.match(ANYTHING)).
will(invokeCallback(
@@ -382,7 +382,7 @@ TEST_F('GoogleNowCardsUnitTest', 'onAlarmShowHasDataCreate', function() {
version: 0}}}}));
var chromeNotificationsCreateSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- chrome_notifications_create(
+ instrumented_notifications_create(
chromeNotificationsCreateSavedArgs.match(eq(testCardId)),
chromeNotificationsCreateSavedArgs.match(eqJSON(testNotification)),
chromeNotificationsCreateSavedArgs.match(ANYTHING)).
@@ -400,7 +400,7 @@ TEST_F('GoogleNowCardsUnitTest', 'onAlarmShowHasDataUpdate', function() {
var test = setUpCardManagerTest(this);
var storageGetSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- storage_get(
+ instrumented_storage_local_get(
storageGetSavedArgs.match(eq('notificationsData')),
storageGetSavedArgs.match(ANYTHING)).
will(invokeCallback(
@@ -417,7 +417,7 @@ TEST_F('GoogleNowCardsUnitTest', 'onAlarmShowHasDataUpdate', function() {
previousVersion:0}}}}));
var chromeNotificationsCreateSavedArgs = new SaveMockArguments();
this.mockApis.expects(once()).
- chrome_notifications_update(
+ instrumented_notifications_update(
testCardId, eqJSON(testNotification), ANYTHING);
// Call tested method.
« 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