diff options
author | dominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 20:10:36 +0000 |
---|---|---|
committer | dominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 20:10:36 +0000 |
commit | 2380b9a98b17983b0b018eba85d862631c58bc68 (patch) | |
tree | 3d1d21febe45308a57beaed9c417192f9d57ec95 /chrome | |
parent | e1429bf81fb01c05cb5a385fec718208740c2d97 (diff) | |
download | chromium_src-2380b9a98b17983b0b018eba85d862631c58bc68.zip chromium_src-2380b9a98b17983b0b018eba85d862631c58bc68.tar.gz chromium_src-2380b9a98b17983b0b018eba85d862631c58bc68.tar.bz2 |
See http://codereview.chromium.org/7337007.
This is a continuation with a fix for the failing tests.
BUG=90745,90837
TEST=none
Review URL: http://codereview.chromium.org/7465051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94537 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete.cc | 9 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete.h | 7 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/autocomplete/search_provider_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 32 | ||||
-rw-r--r-- | chrome/browser/instant/instant_field_trial.cc | 59 | ||||
-rw-r--r-- | chrome/browser/instant/instant_field_trial.h | 58 | ||||
-rw-r--r-- | chrome/browser/resources/options/browser_options.html | 2 | ||||
-rw-r--r-- | chrome/browser/resources/options/browser_options.js | 33 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/browser_options_handler.cc | 11 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/browser_options_handler.h | 3 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 2 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 4 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 1 | ||||
-rw-r--r-- | chrome/test/data/webui/options.js | 2 | ||||
-rw-r--r-- | chrome/test/functional/instant.py | 2 |
17 files changed, 224 insertions, 15 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index 48e7dd6..6a87b83 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -25,6 +25,7 @@ #include "chrome/browser/autocomplete/shortcuts_provider.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/external_protocol/external_protocol_handler.h" +#include "chrome/browser/instant/instant_field_trial.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" @@ -793,7 +794,8 @@ AutocompleteController::AutocompleteController( AutocompleteControllerDelegate* delegate) : delegate_(delegate), done_(true), - in_start_(false) { + in_start_(false), + profile_(profile) { search_provider_ = new SearchProvider(this, profile); providers_.push_back(search_provider_); // TODO(mrossetti): Remove the following and permanently modify the @@ -839,6 +841,7 @@ void AutocompleteController::SetProfile(Profile* profile) { (*i)->SetProfile(profile); input_.Clear(); // Ensure we don't try to do a "minimal_changes" query on a // different profile. + profile_ = profile; } void AutocompleteController::Start( @@ -880,7 +883,9 @@ void AutocompleteController::Start( if (matches_requested == AutocompleteInput::ALL_MATCHES && (text.length() < 6)) { base::TimeTicks end_time = base::TimeTicks::Now(); - std::string name = "Omnibox.QueryTime." + base::IntToString(text.length()); + std::string name = "Omnibox.QueryTime." + + InstantFieldTrial::GetGroupName(profile_) + + base::IntToString(text.length()); base::Histogram* counter = base::Histogram::FactoryGet( name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag); counter->Add(static_cast<int>((end_time - start_time).InMilliseconds())); diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h index 2a19545..487e8bc 100644 --- a/chrome/browser/autocomplete/autocomplete.h +++ b/chrome/browser/autocomplete/autocomplete.h @@ -599,13 +599,14 @@ class AutocompleteController : public ACProviderListener { AutocompleteController(Profile* profile, AutocompleteControllerDelegate* delegate); #ifdef UNIT_TEST - explicit AutocompleteController(const ACProviders& providers) + AutocompleteController(const ACProviders& providers, Profile* profile) : delegate_(NULL), providers_(providers), keyword_provider_(NULL), search_provider_(NULL), done_(true), - in_start_(false) { + in_start_(false), + profile_(profile) { } #endif ~AutocompleteController(); @@ -728,6 +729,8 @@ class AutocompleteController : public ACProviderListener { // notifications until Start() has been invoked on all providers. bool in_start_; + Profile* profile_; + DISALLOW_COPY_AND_ASSIGN(AutocompleteController); }; diff --git a/chrome/browser/autocomplete/autocomplete_unittest.cc b/chrome/browser/autocomplete/autocomplete_unittest.cc index 2b2a17b..be819c7 100644 --- a/chrome/browser/autocomplete/autocomplete_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_unittest.cc @@ -153,7 +153,8 @@ void AutocompleteProviderTest::ResetControllerWithTestProviders( providers_.push_back(providerB); // Reset the controller to contain our new providers. - AutocompleteController* controller = new AutocompleteController(providers_); + AutocompleteController* controller = + new AutocompleteController(providers_, &profile_); controller_.reset(controller); providerA->set_listener(controller); providerB->set_listener(controller); @@ -201,7 +202,8 @@ void AutocompleteProviderTest:: search_provider->AddRef(); providers_.push_back(search_provider); - AutocompleteController* controller = new AutocompleteController(providers_); + AutocompleteController* controller = + new AutocompleteController(providers_, &profile_); controller_.reset(controller); } diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 1de0d8f..7a2da19 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -153,6 +153,10 @@ void SearchProviderTest::SetUp() { provider_ = new SearchProvider(this, &profile_); URLFetcher::set_factory(&test_factory_); + + // Prevent the Instant field trial from kicking in. + PrefService* service = profile_.GetPrefs(); + service->SetBoolean(prefs::kInstantEnabledOnce, true); } void SearchProviderTest::OnProviderUpdate(bool updated_matches) { @@ -623,7 +627,7 @@ TEST_F(SearchProviderTest, UpdateKeywordDescriptions) { ACProviders providers; SearchProvider* provider = provider_.release(); providers.push_back(provider); - AutocompleteController controller(providers); + AutocompleteController controller(providers, &profile_); controller.set_search_provider(provider); provider->set_listener(&controller); controller.Start(ASCIIToUTF16("k t"), string16(), false, false, true, diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index f798e6d..d53fdd6 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -44,6 +44,7 @@ #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/first_run/first_run_browser_process.h" #include "chrome/browser/first_run/upgrade_util.h" +#include "chrome/browser/instant/instant_field_trial.h" #include "chrome/browser/jankometer.h" #include "chrome/browser/language_usage_metrics.h" #include "chrome/browser/metrics/field_trial_synchronizer.h" @@ -645,6 +646,7 @@ void BrowserMainParts::SetupFieldTrials(bool metrics_recording_enabled, if (!proxy_policy_is_set) ProxyConnectionsFieldTrial(); prerender::ConfigurePrefetchAndPrerender(parsed_command_line()); + InstantFieldTrial::Activate(); SpdyFieldTrial(); ConnectBackupJobsFieldTrial(); WarmConnectionFieldTrial(); diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 4e99b3d..2c5a59c 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -7,9 +7,11 @@ #include "base/command_line.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" +#include "base/rand_util.h" #include "build/build_config.h" #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/instant/instant_delegate.h" +#include "chrome/browser/instant/instant_field_trial.h" #include "chrome/browser/instant/instant_loader.h" #include "chrome/browser/instant/instant_loader_manager.h" #include "chrome/browser/instant/promo_counter.h" @@ -49,9 +51,10 @@ InstantController::InstantController(Profile* profile, last_transition_type_(PageTransition::LINK), ALLOW_THIS_IN_INITIALIZER_LIST(destroy_factory_(this)) { PrefService* service = profile->GetPrefs(); - if (service) { - // kInstantWasEnabledOnce was added after instant, set it now to make sure - // it is correctly set. + if (service && + InstantFieldTrial::GetGroup(profile) == InstantFieldTrial::INACTIVE) { + // kInstantEnabledOnce was added after instant, set it now to make sure it + // is correctly set. service->SetBoolean(prefs::kInstantEnabledOnce, true); } } @@ -73,6 +76,9 @@ void InstantController::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterInt64Pref(prefs::kInstantEnabledTime, false, PrefService::UNSYNCABLE_PREF); + prefs->RegisterIntegerPref(prefs::kInstantFieldTrialRandomDraw, + base::RandInt(0, 9999), + PrefService::UNSYNCABLE_PREF); PromoCounter::RegisterUserPrefs(prefs, prefs::kInstantPromo); } @@ -100,7 +106,8 @@ void InstantController::RecordMetrics(Profile* profile) { // static bool InstantController::IsEnabled(Profile* profile) { PrefService* prefs = profile->GetPrefs(); - return prefs->GetBoolean(prefs::kInstantEnabled); + return prefs->GetBoolean(prefs::kInstantEnabled) || + InstantFieldTrial::IsExperimentGroup(profile); } // static @@ -113,11 +120,11 @@ void InstantController::Enable(Profile* profile) { if (!service) return; + service->SetBoolean(prefs::kInstantEnabledOnce, true); service->SetBoolean(prefs::kInstantEnabled, true); service->SetBoolean(prefs::kInstantConfirmDialogShown, true); service->SetInt64(prefs::kInstantEnabledTime, base::Time::Now().ToInternalValue()); - service->SetBoolean(prefs::kInstantEnabledOnce, true); } // static @@ -135,6 +142,12 @@ void InstantController::Disable(Profile* profile) { delta.InMinutes(), 1, 60 * 24 * 10, 50); } + if (InstantFieldTrial::IsExperimentGroup(profile)) { + UMA_HISTOGRAM_COUNTS( + "Instant.FieldTrialOptOut." + InstantFieldTrial::GetGroupName(profile), + 1); + } + service->SetBoolean(prefs::kInstantEnabledOnce, true); service->SetBoolean(prefs::kInstantEnabled, false); } @@ -377,8 +390,10 @@ void InstantController::OnAutocompleteLostFocus( void InstantController::OnAutocompleteGotFocus( TabContentsWrapper* tab_contents) { CommandLine* cl = CommandLine::ForCurrentProcess(); - if (!cl->HasSwitch(switches::kPreloadInstantSearch)) + if (!cl->HasSwitch(switches::kPreloadInstantSearch) && + !InstantFieldTrial::IsExperimentGroup(tab_contents->profile())) { return; + } if (is_active_) return; @@ -389,7 +404,7 @@ void InstantController::OnAutocompleteGotFocus( return; const TemplateURL* template_url = model->GetDefaultSearchProvider(); - if (!template_url || !template_url->instant_url()) + if (!template_url || !template_url->instant_url() || !template_url->id()) return; if (tab_contents != tab_contents_) @@ -705,7 +720,8 @@ InstantController::PreviewCondition InstantController::GetPreviewConditionFor( return PREVIEW_CONDITION_BLACKLISTED; const CommandLine* cl = CommandLine::ForCurrentProcess(); - if (cl->HasSwitch(switches::kRestrictInstantToSearch) && + if ((cl->HasSwitch(switches::kRestrictInstantToSearch) || + InstantFieldTrial::IsExperimentGroup(tab_contents_->profile())) && match.type != AutocompleteMatch::SEARCH_WHAT_YOU_TYPED && match.type != AutocompleteMatch::SEARCH_HISTORY && match.type != AutocompleteMatch::SEARCH_SUGGEST && diff --git a/chrome/browser/instant/instant_field_trial.cc b/chrome/browser/instant/instant_field_trial.cc new file mode 100644 index 0000000..2c3e63d --- /dev/null +++ b/chrome/browser/instant/instant_field_trial.cc @@ -0,0 +1,59 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/instant/instant_field_trial.h" + +#include "chrome/browser/prefs/pref_service.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/common/pref_names.h" + +namespace { +bool field_trial_active_ = false; +} + +// static +void InstantFieldTrial::Activate() { + field_trial_active_ = true; +} + +// static +InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) { + if (!field_trial_active_) + return INACTIVE; + + if (profile->IsOffTheRecord()) + return INACTIVE; + + const PrefService* prefs = profile->GetPrefs(); + if (!prefs || + prefs->GetBoolean(prefs::kInstantEnabledOnce) || + prefs->IsManagedPreference(prefs::kInstantEnabled)) { + return INACTIVE; + } + + const int random = prefs->GetInteger(prefs::kInstantFieldTrialRandomDraw); + return random < 4500 ? CONTROL1 : // 45% + random < 9000 ? CONTROL2 : // 45% + random < 9500 ? EXPERIMENT1 // 5% + : EXPERIMENT2; // 5% +} + +// static +bool InstantFieldTrial::IsExperimentGroup(Profile* profile) { + Group group = GetGroup(profile); + return group == EXPERIMENT1 || group == EXPERIMENT2; +} + +// static +std::string InstantFieldTrial::GetGroupName(Profile* profile) { + switch (GetGroup(profile)) { + case INACTIVE: return "InstantInactive"; + case CONTROL1: return "InstantControl1"; + case CONTROL2: return "InstantControl2"; + case EXPERIMENT1: return "InstantExperiment1"; + case EXPERIMENT2: return "InstantExperiment2"; + } + NOTREACHED(); + return "InstantUnknown"; +} diff --git a/chrome/browser/instant/instant_field_trial.h b/chrome/browser/instant/instant_field_trial.h new file mode 100644 index 0000000..fd808f6 --- /dev/null +++ b/chrome/browser/instant/instant_field_trial.h @@ -0,0 +1,58 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_ +#define CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_ + +#include <string> + +#include "base/basictypes.h" + +class Profile; + +// This class manages the Instant field trial. Each user is in exactly one of +// two field trial groups: Control or Experiment. +// - Control and Experiment are all the other users, i.e., those who have never +// touched the Preferences option. Some percentage of these users are chosen +// into the Experiment group and get Instant enabled automatically. The rest +// fall into the Control group; for them, Instant remains disabled by default. +// - Control and Experiment are further split into two subgroups each, in order +// to detect bias between them (when analyzing metrics). The subgroups are +// treated identically for all other purposes. +// +// There is a possibility that the field trial is not active. +// - Inactive users are those who have played with the Instant option in the +// Preferences page, or those for whom group policy provides an override, or +// those with an incognito profile, etc. The field trial is inactive for such +// users, so their Instant preference setting is respected. The field trial is +// initially inactive so testing is not affected by the field trial. +class InstantFieldTrial { + public: + enum Group { + INACTIVE, + CONTROL1, + CONTROL2, + EXPERIMENT1, + EXPERIMENT2, + }; + + // Activate the field trial. Before this call, all calls to GetGroup will + // return INACTIVE. + static void Activate(); + + // Return the field trial group this profile belongs to. + static Group GetGroup(Profile* profile); + + // Check if the group is either of the two experiment subgroups. + static bool IsExperimentGroup(Profile* profile); + + // Returns a string describing the user's group. Can be added to histogram + // names, to split histograms by field trial groups. + static std::string GetGroupName(Profile* profile); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(InstantFieldTrial); +}; + +#endif // CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_ diff --git a/chrome/browser/resources/options/browser_options.html b/chrome/browser/resources/options/browser_options.html index d03df9b..e23b0b8 100644 --- a/chrome/browser/resources/options/browser_options.html +++ b/chrome/browser/resources/options/browser_options.html @@ -94,6 +94,8 @@ <div id="instantOption" class="checkbox"> <label> <!-- TODO(estade): metric? --> + <input id="instantFieldTrialCheckbox" type="checkbox" + checked="checked" hidden> <input id="instantEnabledCheckbox" type="checkbox" pref="instant.enabled"> <span i18n-content="instantName"></span> diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js index ffd838e..e8b46fb 100644 --- a/chrome/browser/resources/options/browser_options.js +++ b/chrome/browser/resources/options/browser_options.js @@ -83,9 +83,18 @@ cr.define('options', function() { return true; }; + $('instantFieldTrialCheckbox').addEventListener('change', + function(event) { + this.checked = true; + chrome.send('disableInstant'); + }); + Preferences.getInstance().addEventListener('instant.confirm_dialog_shown', this.onInstantConfirmDialogShownChanged_.bind(this)); + Preferences.getInstance().addEventListener('instant.enabled', + this.onInstantEnabledChanged_.bind(this)); + var homepageField = $('homepageURL'); $('homepageUseNTPButton').onchange = this.handleHomepageUseNTPButtonChange_.bind(this); @@ -169,6 +178,26 @@ cr.define('options', function() { }, /** + * Called when the value of the instant.enabled preference changes. Request + * the state of the Instant field trial experiment. + * @param {Event} event Change event. + * @private + */ + onInstantEnabledChanged_: function(event) { + chrome.send('getInstantFieldTrialStatus'); + }, + + /** + * Called to set the Instant field trial status. + * @param {boolean} enabled If true, the experiment is enabled. + * @private + */ + setInstantFieldTrialStatus_: function(enabled) { + $('instantEnabledCheckbox').hidden = enabled; + $('instantFieldTrialCheckbox').hidden = !enabled; + }, + + /** * Update the Default Browsers section based on the current state. * @param {string} statusString Description of the current default state. * @param {boolean} isDefault Whether or not the browser is currently @@ -489,6 +518,10 @@ cr.define('options', function() { BrowserOptions.getInstance().updateAutocompleteSuggestions_(suggestions); }; + BrowserOptions.setInstantFieldTrialStatus = function(enabled) { + BrowserOptions.getInstance().setInstantFieldTrialStatus_(enabled); + }; + // Export return { BrowserOptions: BrowserOptions diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index 622b6e01..9a541ee 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -16,6 +16,7 @@ #include "chrome/browser/custom_home_pages_table_model.h" #include "chrome/browser/instant/instant_confirm_dialog.h" #include "chrome/browser/instant/instant_controller.h" +#include "chrome/browser/instant/instant_field_trial.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/session_startup_pref.h" @@ -129,6 +130,9 @@ void BrowserOptionsHandler::RegisterMessages() { web_ui_->RegisterMessageCallback( "disableInstant", NewCallback(this, &BrowserOptionsHandler::DisableInstant)); + web_ui_->RegisterMessageCallback( + "getInstantFieldTrialStatus", + NewCallback(this, &BrowserOptionsHandler::GetInstantFieldTrialStatus)); } void BrowserOptionsHandler::Initialize() { @@ -484,6 +488,13 @@ void BrowserOptionsHandler::DisableInstant(const ListValue* args) { InstantController::Disable(web_ui_->GetProfile()); } +void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) { + FundamentalValue enabled( + InstantFieldTrial::IsExperimentGroup(web_ui_->GetProfile())); + web_ui_->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus", + enabled); +} + void BrowserOptionsHandler::OnResultChanged(bool default_match_changed) { const AutocompleteResult& result = autocomplete_controller_->result(); ListValue suggestions; diff --git a/chrome/browser/ui/webui/options/browser_options_handler.h b/chrome/browser/ui/webui/options/browser_options_handler.h index e400130..edef235 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.h +++ b/chrome/browser/ui/webui/options/browser_options_handler.h @@ -94,6 +94,9 @@ class BrowserOptionsHandler : public OptionsPageUIHandler, void EnableInstant(const ListValue* args); void DisableInstant(const ListValue* args); + // Called to request information about the Instant field trial. + void GetInstantFieldTrialStatus(const ListValue* args); + // Returns the string ID for the given default browser state. int StatusStringIdForState(ShellIntegration::DefaultWebClientState state); diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 521a675..08f6128 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1344,6 +1344,8 @@ 'browser/instant/instant_controller.cc', 'browser/instant/instant_controller.h', 'browser/instant/instant_delegate.h', + 'browser/instant/instant_field_trial.cc', + 'browser/instant/instant_field_trial.h', 'browser/instant/instant_loader.cc', 'browser/instant/instant_loader.h', 'browser/instant/instant_loader_delegate.h', diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 29e9d9a..d49a5f1 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -275,6 +275,10 @@ const char kInstantEnabledOnce[] = "instant.enabled_once"; // Time when instant was last enabled. const char kInstantEnabledTime[] = "instant.enabled_time"; +// Random number drawn and used by the Instant field trial. Stored in prefs to +// provide a consistent field trial experience across browser restarts. +const char kInstantFieldTrialRandomDraw[] = "instant.field_trial_random_draw"; + // Used to maintain instant promo keys. See PromoCounter for details of subkeys // that are used. const char kInstantPromo[] = "instant.promo"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index c554830..fdd80cc 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -95,6 +95,7 @@ extern const char kInstantConfirmDialogShown[]; extern const char kInstantEnabled[]; extern const char kInstantEnabledOnce[]; extern const char kInstantEnabledTime[]; +extern const char kInstantFieldTrialRandomDraw[]; extern const char kInstantPromo[]; extern const char kMultipleProfilePrefMigration[]; extern const char kNetworkPredictionEnabled[]; diff --git a/chrome/test/data/webui/options.js b/chrome/test/data/webui/options.js index 4083333..00b4763 100644 --- a/chrome/test/data/webui/options.js +++ b/chrome/test/data/webui/options.js @@ -40,6 +40,8 @@ OptionsWebUITest.prototype = { setObjectPref: function() {}, clearPref: function() {}, coreOptionsUserMetricsAction: function() {}, + // TODO(scr): Handle this new message: + // getInstantFieldTrialStatus: function() {}, }; // Create the actual mock and register stubs for methods expected to be diff --git a/chrome/test/functional/instant.py b/chrome/test/functional/instant.py index 917b10f..796b687 100644 --- a/chrome/test/functional/instant.py +++ b/chrome/test/functional/instant.py @@ -21,6 +21,7 @@ class InstantSettingsTest(pyauto.PyUITest): msg='Instant is enabled by default.') # Enable instant. self.SetPrefs(pyauto.kInstantEnabled, True) + self.SetPrefs(pyauto.kInstantEnabledOnce, True) self.assertTrue(self.GetPrefsInfo().Prefs(pyauto.kInstantEnabled), msg='Instant is not enabled.') self.SetOmniboxText('google.com') @@ -41,6 +42,7 @@ class InstantTest(pyauto.PyUITest): def setUp(self): pyauto.PyUITest.setUp(self) self.SetPrefs(pyauto.kInstantEnabled, True) + self.SetPrefs(pyauto.kInstantEnabledOnce, True) def _DoneLoading(self): info = self.GetInstantInfo() |