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

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

Issue 23127002: Switch Google Now Background Toggle to use Experiment Variations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Finch
Patch Set: Changed Condition to Enabled Background 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/background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64c799ed64681bb4582ebefd79725ddb6c435263..f6307e361d13cf8c11d8004432a2e1ec8916cf2a 100644
--- a/chrome/browser/resources/google_now/background_unittest.gtestjs
+++ b/chrome/browser/resources/google_now/background_unittest.gtestjs
@@ -63,7 +63,7 @@ function mockInitializeDependencies(fixture) {
'authenticationManager.isSignedIn',
'chrome.location.clearWatch',
'chrome.storage.local.set',
- 'instrumented.metricsPrivate.getFieldTrial',
+ 'instrumented.metricsPrivate.getVariationParams',
'instrumented.notifications.getAll',
'instrumented.preferencesPrivate.googleGeolocationAccessEnabled.get',
'instrumented.storage.local.get',
@@ -83,14 +83,16 @@ function mockInitializeDependencies(fixture) {
* @param {string} testIdentityToken getAuthToken callback token.
* @param {boolean} testGeolocationPref Geolocation Preference callback value.
* @param {boolean} testUserRespondedToToast User Response to toast
- & callback value.
+ * callback value.
+ * @param {object} testExperimentVariationParams Response of
+ * metricsPrivate.getVariationParams
*/
function expectStateMachineCalls(
fixture,
testIdentityToken,
testGeolocationPref,
testUserRespondedToToast,
- testExperimentResponse) {
+ testExperimentVariationParams) {
var authenticationManagerIsSignedInSavedArgs = new SaveMockArguments();
fixture.mockApis.expects(once()).
authenticationManager_isSignedIn(
@@ -100,13 +102,13 @@ function expectStateMachineCalls(
0,
testIdentityToken));
- var getFieldTrialSavedArgs = new SaveMockArguments();
+ var getVariationParamsSavedArgs = new SaveMockArguments();
fixture.mockApis.expects(once()).
- instrumented_metricsPrivate_getFieldTrial(
- getFieldTrialSavedArgs.match(ANYTHING),
- getFieldTrialSavedArgs.match(ANYTHING)).
+ instrumented_metricsPrivate_getVariationParams(
+ getVariationParamsSavedArgs.match(ANYTHING),
+ getVariationParamsSavedArgs.match(ANYTHING)).
will(invokeCallback(
- getFieldTrialSavedArgs, 1, testExperimentResponse));
+ getVariationParamsSavedArgs, 1, testExperimentVariationParams));
var googleGeolocationPrefGetSavedArgs = new SaveMockArguments();
fixture.mockApis.expects(once()).
@@ -174,7 +176,7 @@ TEST_F(
var testIdentityToken = undefined;
var testGeolocationPref = false;
var testUserRespondedToToast = {};
- var testExperimentResponse = '';
+ var testExperimentVariationParams = {};
mockInitializeDependencies(this);
@@ -191,7 +193,7 @@ TEST_F(
testIdentityToken,
testGeolocationPref,
testUserRespondedToToast,
- testExperimentResponse);
+ testExperimentVariationParams);
var chromeNotificationGetAllSavedArgs = new SaveMockArguments();
this.mockApis.expects(exactly(2)).
@@ -220,7 +222,7 @@ TEST_F(
var testIdentityToken = undefined;
var testGeolocationPref = false;
var testUserRespondedToToast = {};
- var testExperimentResponse = '';
+ var testExperimentVariationParams = {};
mockInitializeDependencies(this);
@@ -237,7 +239,7 @@ TEST_F(
testIdentityToken,
testGeolocationPref,
testUserRespondedToToast,
- testExperimentResponse);
+ testExperimentVariationParams);
var chromeNotificationGetAllSavedArgs = new SaveMockArguments();
this.mockApis.expects(exactly(2)).
@@ -264,7 +266,7 @@ TEST_F(
var testIdentityToken = 'some identity token';
var testGeolocationPref = false;
var testUserRespondedToToast = {};
- var testExperimentResponse = '';
+ var testExperimentVariationParams = {};
mockInitializeDependencies(this);
@@ -278,7 +280,7 @@ TEST_F(
testIdentityToken,
testGeolocationPref,
testUserRespondedToToast,
- testExperimentResponse);
+ testExperimentVariationParams);
var chromeNotificationGetAllSavedArgs = new SaveMockArguments();
this.mockApis.expects(exactly(2)).
@@ -303,7 +305,7 @@ TEST_F('GoogleNowBackgroundUnitTest', 'Initialize_RunGoogleNow', function() {
var testIdentityToken = 'some identity token';
var testGeolocationPref = true;
var testUserRespondedToToast = {userRespondedToToast: true};
- var testExperimentResponse = '';
+ var testExperimentVariationParams = {};
mockInitializeDependencies(this);
@@ -317,7 +319,7 @@ TEST_F('GoogleNowBackgroundUnitTest', 'Initialize_RunGoogleNow', function() {
testIdentityToken,
testGeolocationPref,
testUserRespondedToToast,
- testExperimentResponse);
+ testExperimentVariationParams);
var chromeNotificationGetAllSavedArgs = new SaveMockArguments();
this.mockApis.expects(exactly(2)).
@@ -342,7 +344,7 @@ TEST_F('GoogleNowBackgroundUnitTest', 'Initialize_NoGeolocation', function() {
var testIdentityToken = 'some identity token';
var testGeolocationPref = false;
var testUserRespondedToToast = {userRespondedToToast: true};
- var testExperimentResponse = '';
+ var testExperimentVariationParams = {};
mockInitializeDependencies(this);
@@ -359,7 +361,7 @@ TEST_F('GoogleNowBackgroundUnitTest', 'Initialize_NoGeolocation', function() {
testIdentityToken,
testGeolocationPref,
testUserRespondedToToast,
- testExperimentResponse);
+ testExperimentVariationParams);
var chromeNotificationGetAllSavedArgs = new SaveMockArguments();
this.mockApis.expects(exactly(2)).
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698