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

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

Issue 170283015: Revert of Convert Google Now's Authentication Manager to use Promises (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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/google_now/background_unittest.gtestjs
diff --git a/chrome/browser/resources/google_now/background_unittest.gtestjs b/chrome/browser/resources/google_now/background_unittest.gtestjs
index 5061584dfbea98880d57a924e8b51dc2acbe25a9..81dbadcd1cbe32e82a5a7879278f5263f01d082c 100644
--- a/chrome/browser/resources/google_now/background_unittest.gtestjs
+++ b/chrome/browser/resources/google_now/background_unittest.gtestjs
@@ -70,7 +70,6 @@
'instrumented.notifications.getPermissionLevel',
'instrumented.preferencesPrivate.googleGeolocationAccessEnabled.get',
'instrumented.storage.local.get',
- 'instrumented.webstorePrivate.getBrowserLogin',
'tasks.add',
'updateCardsAttempts.isRunning',
'updateCardsAttempts.stop'
@@ -100,11 +99,14 @@
testExperimentVariationParams,
testNotificationPermissionLevel,
testGoogleNowEnabled) {
+ var authenticationManagerIsSignedInSavedArgs = new SaveMockArguments();
fixture.mockApis.expects(once()).
- authenticationManager_isSignedIn().
- will(returnValue(new Promise(function(resolve) {
- resolve(!!testIdentityToken);
- })));
+ authenticationManager_isSignedIn(
+ authenticationManagerIsSignedInSavedArgs.match(ANYTHING)).
+ will(invokeCallback(
+ authenticationManagerIsSignedInSavedArgs,
+ 0,
+ testIdentityToken));
var getVariationParamsSavedArgs = new SaveMockArguments();
fixture.mockApis.expects(once()).
@@ -131,13 +133,13 @@
0,
testNotificationPermissionLevel))
- var storageGetSavedArgs = new SaveMockArguments();
- fixture.mockApis.expects(once()).
- instrumented_storage_local_get(
- storageGetSavedArgs.match(eq('googleNowEnabled')),
- storageGetSavedArgs.match(ANYTHING)).
+ var storageGetSavedArgs = new SaveMockArguments();
+ fixture.mockApis.expects(once()).
+ instrumented_storage_local_get(
+ storageGetSavedArgs.match(eq('googleNowEnabled')),
+ storageGetSavedArgs.match(ANYTHING)).
will(invokeCallback(
- storageGetSavedArgs, 1, {googleNowEnabled: testGoogleNowEnabled}));
+ storageGetSavedArgs, 1, {googleNowEnabled: testGoogleNowEnabled}));
fixture.mockGlobals.expects(once()).
setBackgroundEnable(ANYTHING);
@@ -595,7 +597,7 @@
// Check the output value.
var expectedCombinedCards = {
'EXISTING CARD': [
- 1,
+ 1,
{
receivedNotification: receivedNotificationNoShowTime,
hideTime: 11000
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | chrome/browser/resources/google_now/common_test_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698