summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 16:35:32 +0000
committersreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-25 16:35:32 +0000
commit1499b7dd537a002bcda757cc795e92f865fa9af7 (patch)
tree849194072ff3b8e01770aec9054fe07401d95fe8
parent19e15b1833ce965710b5f82822ec1708b60c949e (diff)
downloadchromium_src-1499b7dd537a002bcda757cc795e92f865fa9af7.zip
chromium_src-1499b7dd537a002bcda757cc795e92f865fa9af7.tar.gz
chromium_src-1499b7dd537a002bcda757cc795e92f865fa9af7.tar.bz2
Remove Instant field trials.
This unlaunches the SILENT mode, but only for a little while. After the rest of the refactoring is done, I'll put back the SILENT mode, along with appropriate browser tests for all modes. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10453011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139057 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc5
-rw-r--r--chrome/browser/chrome_browser_main.cc2
-rw-r--r--chrome/browser/instant/OWNERS1
-rw-r--r--chrome/browser/instant/instant_browsertest.cc179
-rw-r--r--chrome/browser/instant/instant_controller.cc91
-rw-r--r--chrome/browser/instant/instant_controller.h22
-rw-r--r--chrome/browser/instant/instant_field_trial.cc121
-rw-r--r--chrome/browser/instant/instant_field_trial.h56
-rw-r--r--chrome/browser/metrics/metrics_service.h1
-rw-r--r--chrome/browser/resources/options2/browser_options.html2
-rw-r--r--chrome/browser/resources/options2/browser_options.js29
-rw-r--r--chrome/browser/search_engines/search_terms_data.cc5
-rw-r--r--chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc3
-rw-r--r--chrome/browser/ui/browser.cc9
-rw-r--r--chrome/browser/ui/webui/options2/browser_options_handler2.cc14
-rw-r--r--chrome/browser/ui/webui/options2/browser_options_handler2.h3
-rw-r--r--chrome/browser/ui/webui/options2/options2_browsertest.js2
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/common/chrome_switches.cc12
-rw-r--r--chrome/common/chrome_switches.h5
-rw-r--r--chrome/common/pref_names.cc3
-rw-r--r--chrome/common/pref_names.h1
-rw-r--r--chrome/test/base/test_launcher_utils.cc4
23 files changed, 53 insertions, 519 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index d646a2f..5ca0926 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -28,7 +28,6 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/extensions/extension_service.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"
@@ -950,8 +949,7 @@ 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()) +
- InstantFieldTrial::GetModeAsString(profile_);
+ std::string name = "Omnibox.QueryTime." + 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()));
@@ -1188,4 +1186,3 @@ AutocompleteLog::AutocompleteLog(
AutocompleteLog::~AutocompleteLog() {
}
-
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 386932c..7162839 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -46,7 +46,6 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/gpu_blacklist.h"
#include "chrome/browser/gpu_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"
@@ -1094,7 +1093,6 @@ void ChromeBrowserMainParts::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/OWNERS b/chrome/browser/instant/OWNERS
index 90b3e80..20df7d8 100644
--- a/chrome/browser/instant/OWNERS
+++ b/chrome/browser/instant/OWNERS
@@ -1 +1,2 @@
sky@chromium.org
+sreeram@chromium.org
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index 16104e2..960d116 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -54,8 +54,6 @@ class InstantTest : public InProcessBrowserTest {
}
void EnableInstant() {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kInstantFieldTrial, switches::kInstantFieldTrialInstant);
InstantController::Enable(browser()->profile());
}
@@ -835,180 +833,3 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(TaskManagerPrefix)) {
string16 title = task_manager->GetResourceTitle(2);
EXPECT_TRUE(StartsWith(title, prefix, true)) << title << " vs " << prefix;
}
-
-// Tests the INSTANT experiment of the field trial.
-class InstantFieldTrialInstantTest : public InstantTest {
- public:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- command_line->AppendSwitchASCII(switches::kInstantFieldTrial,
- switches::kInstantFieldTrialInstant);
- }
-};
-
-// Tests that instant is active, even without calling EnableInstant().
-IN_PROC_BROWSER_TEST_F(InstantFieldTrialInstantTest, MAYBE(ExperimentEnabled)) {
- // Check that instant is enabled, despite not setting the preference.
- Profile* profile = browser()->profile();
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(prefs::kInstantEnabled));
- EXPECT_TRUE(InstantController::IsEnabled(profile));
-
- ASSERT_TRUE(test_server()->Start());
- SetupInstantProvider("instant.html");
- DetermineInstantSupport();
- SearchAndWaitForPreviewToShow();
-
- // Check that instant is active and showing a preview.
- EXPECT_TRUE(preview());
- EXPECT_TRUE(loader()->ready());
- EXPECT_TRUE(instant()->is_displayable());
- EXPECT_TRUE(instant()->IsCurrent());
-
- // Check that the suggested text has been set in the omnibox.
- EXPECT_EQ("defghi", GetSuggestion());
- EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText()));
-
- // Press <Enter> in the omnibox, causing the preview to be committed.
- WebContents* preview_tab = preview()->web_contents();
- ASSERT_TRUE(PressEnter());
-
- // The preview contents should now be the active tab contents.
- EXPECT_FALSE(preview());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
- EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents());
-}
-
-// Tests the HIDDEN experiment of the field trial.
-class InstantFieldTrialHiddenTest : public InstantTest {
- public:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- command_line->AppendSwitchASCII(switches::kInstantFieldTrial,
- switches::kInstantFieldTrialHidden);
- }
-};
-
-// Tests that instant is active, even without calling EnableInstant().
-IN_PROC_BROWSER_TEST_F(InstantFieldTrialHiddenTest, MAYBE(ExperimentEnabled)) {
- // Check that instant is enabled, despite not setting the preference.
- Profile* profile = browser()->profile();
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(prefs::kInstantEnabled));
- EXPECT_TRUE(InstantController::IsEnabled(profile));
-
- ASSERT_TRUE(test_server()->Start());
- SetupInstantProvider("instant.html");
- DetermineInstantSupport();
-
- // Type into the omnibox, but don't press <Enter> yet.
- omnibox()->SetUserText(ASCIIToUTF16("def"));
- ASSERT_TRUE(WaitForMessageToBeProcessedByRenderer());
-
- // Check that instant is active, but the preview is not showing.
- EXPECT_TRUE(preview());
- EXPECT_TRUE(loader()->ready());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
-
- // Check that the suggested text hasn't actually been set in the omnibox.
- EXPECT_EQ("defghi", GetSuggestion());
- EXPECT_EQ("def", UTF16ToUTF8(omnibox()->GetText()));
-
- // Press <Enter> in the omnibox, causing the preview to be committed.
- WebContents* preview_tab = preview()->web_contents();
- ASSERT_TRUE(PressEnter());
-
- // The preview contents should now be the active tab contents.
- EXPECT_FALSE(preview());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
- EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents());
-}
-
-// Tests the SILENT experiment of the field trial.
-class InstantFieldTrialSilentTest : public InstantTest {
- public:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- command_line->AppendSwitchASCII(switches::kInstantFieldTrial,
- switches::kInstantFieldTrialSilent);
- }
-};
-
-// Tests that instant is active, even without calling EnableInstant().
-IN_PROC_BROWSER_TEST_F(InstantFieldTrialSilentTest, MAYBE(ExperimentEnabled)) {
- // Check that instant is enabled, despite not setting the preference.
- Profile* profile = browser()->profile();
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(prefs::kInstantEnabled));
- EXPECT_TRUE(InstantController::IsEnabled(profile));
-
- ASSERT_TRUE(test_server()->Start());
- SetupInstantProvider("instant.html");
- DetermineInstantSupport();
-
- // Type into the omnibox, but don't press <Enter> yet.
- omnibox()->SetUserText(ASCIIToUTF16("def"));
- ASSERT_TRUE(WaitForMessageToBeProcessedByRenderer());
-
- // Check that instant is active, but the preview is not showing.
- EXPECT_TRUE(preview());
- EXPECT_FALSE(loader()->ready());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
-
- // There are no suggestions, as the loader hasn't seen the query yet.
- EXPECT_EQ("", GetSuggestion());
- EXPECT_EQ("def", UTF16ToUTF8(omnibox()->GetText()));
-
- // Press <Enter> in the omnibox, causing the preview to be committed.
- WebContents* preview_tab = preview()->web_contents();
- ASSERT_TRUE(PressEnter());
-
- // The preview contents should now be the active tab contents.
- EXPECT_FALSE(preview());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
- EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents());
-}
-
-// Tests the SUGGEST experiment of the field trial.
-class InstantFieldTrialSuggestTest : public InstantTest {
- public:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- command_line->AppendSwitchASCII(switches::kInstantFieldTrial,
- switches::kInstantFieldTrialSuggest);
- }
-};
-
-// Tests that instant is active, even without calling EnableInstant().
-IN_PROC_BROWSER_TEST_F(InstantFieldTrialSuggestTest, MAYBE(ExperimentEnabled)) {
- // Check that instant is enabled, despite not setting the preference.
- Profile* profile = browser()->profile();
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(prefs::kInstantEnabled));
- EXPECT_TRUE(InstantController::IsEnabled(profile));
-
- ASSERT_TRUE(test_server()->Start());
- SetupInstantProvider("instant.html");
- DetermineInstantSupport();
-
- // Type into the omnibox, but don't press <Enter> yet.
- omnibox()->SetUserText(ASCIIToUTF16("def"));
- ASSERT_TRUE(WaitForMessageToBeProcessedByRenderer());
-
- // Check that instant is active, but the preview is not showing.
- EXPECT_TRUE(preview());
- EXPECT_TRUE(loader()->ready());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
-
- // Check that the suggested text has actually been set in the omnibox.
- EXPECT_EQ("defghi", GetSuggestion());
- EXPECT_EQ("defghi", UTF16ToUTF8(omnibox()->GetText()));
-
- // Press <Enter> in the omnibox, causing the preview to be committed.
- WebContents* preview_tab = preview()->web_contents();
- ASSERT_TRUE(PressEnter());
-
- // The preview contents should now be the active tab contents.
- EXPECT_FALSE(preview());
- EXPECT_FALSE(instant()->is_displayable());
- EXPECT_FALSE(instant()->IsCurrent());
- EXPECT_EQ(preview_tab, browser()->GetSelectedWebContents());
-}
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index b6de819c..d93ed1b0 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -8,11 +8,9 @@
#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/platform_util.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -36,7 +34,8 @@
#endif
InstantController::InstantController(Profile* profile,
- InstantDelegate* delegate)
+ InstantDelegate* delegate,
+ Mode mode)
: delegate_(delegate),
template_url_service_(TemplateURLServiceFactory::GetForProfile(profile)),
tab_contents_(NULL),
@@ -44,14 +43,11 @@ InstantController::InstantController(Profile* profile,
is_out_of_date_(true),
commit_on_mouse_up_(false),
last_transition_type_(content::PAGE_TRANSITION_LINK),
- ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
+ mode_(mode) {
DCHECK(template_url_service_);
- PrefService* prefs = profile->GetPrefs();
- if (prefs && prefs->GetBoolean(prefs::kInstantEnabled)) {
- // kInstantEnabledOnce was added after Instant, set it now to make sure it
- // is correctly set.
- prefs->SetBoolean(prefs::kInstantEnabledOnce, true);
- }
+ DCHECK(mode_ == INSTANT || mode_ == SUGGEST || mode_ == HIDDEN ||
+ mode_ == SILENT);
}
InstantController::~InstantController() {
@@ -65,9 +61,6 @@ void InstantController::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterBooleanPref(prefs::kInstantEnabled,
false,
PrefService::SYNCABLE_PREF);
- prefs->RegisterBooleanPref(prefs::kInstantEnabledOnce,
- false,
- PrefService::SYNCABLE_PREF);
}
// static
@@ -77,7 +70,8 @@ void InstantController::RecordMetrics(Profile* profile) {
// static
bool InstantController::IsEnabled(Profile* profile) {
- return InstantFieldTrial::GetMode(profile) != InstantFieldTrial::CONTROL;
+ const PrefService* prefs = profile ? profile->GetPrefs() : 0;
+ return prefs && prefs->GetBoolean(prefs::kInstantEnabled);
}
// static
@@ -86,14 +80,9 @@ void InstantController::Enable(Profile* profile) {
if (!service)
return;
- base::Histogram* histogram = base::LinearHistogram::FactoryGet(
- "Instant.Preference" + InstantFieldTrial::GetModeAsString(profile),
- 1, 2, 3, base::Histogram::kUmaTargetedHistogramFlag);
- histogram->Add(1);
-
- service->SetBoolean(prefs::kInstantEnabledOnce, true);
service->SetBoolean(prefs::kInstantEnabled, true);
service->SetBoolean(prefs::kInstantConfirmDialogShown, true);
+ UMA_HISTOGRAM_ENUMERATION("Instant.Preference", 1, 2);
}
// static
@@ -102,13 +91,8 @@ void InstantController::Disable(Profile* profile) {
if (!service || !IsEnabled(profile))
return;
- base::Histogram* histogram = base::LinearHistogram::FactoryGet(
- "Instant.Preference" + InstantFieldTrial::GetModeAsString(profile),
- 1, 2, 3, base::Histogram::kUmaTargetedHistogramFlag);
- histogram->Add(0);
-
- service->SetBoolean(prefs::kInstantEnabledOnce, true);
service->SetBoolean(prefs::kInstantEnabled, false);
+ UMA_HISTOGRAM_ENUMERATION("Instant.Preference", 0, 2);
}
// static
@@ -143,17 +127,14 @@ bool InstantController::Update(TabContentsWrapper* tab_contents,
return false;
}
- if (!loader_.get()) {
- loader_.reset(new InstantLoader(this, template_url->id(),
- InstantFieldTrial::GetModeAsString(tab_contents->profile())));
- }
+ if (!loader_.get())
+ loader_.reset(new InstantLoader(this, template_url->id(), std::string()));
- // In some rare cases (involving group policy), Instant can go from the field
- // trial to normal mode, with no intervening call to DestroyPreviewContents().
+ // In some rare cases (involving group policy), Instant can go from a hidden
+ // mode to normal mode, with no intervening call to DestroyPreviewContents().
// This would leave the loader in a weird state, which would manifest if the
// user pressed <Enter> without calling Update(). TODO(sreeram): Handle it.
- if (InstantFieldTrial::GetMode(tab_contents->profile()) ==
- InstantFieldTrial::SILENT) {
+ if (mode_ == SILENT) {
// For the SILENT mode, we process |user_text| at commit time, which means
// we're never really out of date.
is_out_of_date_ = false;
@@ -179,11 +160,8 @@ void InstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
// bounds are in sync.
omnibox_bounds_ = bounds;
- if (loader_.get() && !is_out_of_date_ &&
- InstantFieldTrial::GetMode(tab_contents_->profile()) ==
- InstantFieldTrial::INSTANT) {
+ if (loader_.get() && !is_out_of_date_ && mode_ == INSTANT)
loader_->SetOmniboxBounds(bounds);
- }
}
void InstantController::DestroyPreviewContents() {
@@ -218,11 +196,8 @@ bool InstantController::PrepareForCommit() {
if (is_out_of_date_ || !loader_.get())
return false;
- const InstantFieldTrial::Mode mode =
- InstantFieldTrial::GetMode(tab_contents_->profile());
-
// If we are in the visible (INSTANT) mode, return the status of the preview.
- if (mode == InstantFieldTrial::INSTANT)
+ if (mode_ == INSTANT)
return IsCurrent();
const TemplateURL* template_url =
@@ -236,7 +211,7 @@ bool InstantController::PrepareForCommit() {
// In the SUGGEST and HIDDEN modes, we must have sent an Update() by now, so
// check if the loader failed to process it.
- if ((mode == InstantFieldTrial::SUGGEST || mode == InstantFieldTrial::HIDDEN)
+ if ((mode_ == SUGGEST || mode_ == HIDDEN)
&& (!loader_->ready() || !loader_->http_status_ok())) {
return false;
}
@@ -359,10 +334,8 @@ void InstantController::OnAutocompleteGotFocus(
tab_contents_ = tab_contents;
- if (!loader_.get()) {
- loader_.reset(new InstantLoader(this, template_url->id(),
- InstantFieldTrial::GetModeAsString(tab_contents->profile())));
- }
+ if (!loader_.get())
+ loader_.reset(new InstantLoader(this, template_url->id(), std::string()));
loader_->MaybeLoadInstantURL(tab_contents, template_url);
}
@@ -402,9 +375,7 @@ void InstantController::SetSuggestedTextFor(
if (is_out_of_date_)
return;
- const InstantFieldTrial::Mode mode =
- InstantFieldTrial::GetMode(tab_contents_->profile());
- if (mode == InstantFieldTrial::INSTANT || mode == InstantFieldTrial::SUGGEST)
+ if (mode_ == INSTANT || mode_ == SUGGEST)
delegate_->SetSuggestedText(text, behavior);
}
@@ -449,24 +420,16 @@ void InstantController::InstantLoaderContentsFocused() {
#if defined(USE_AURA)
// On aura the omnibox only receives a focus lost if we initiate the focus
// change. This does that.
- if (InstantFieldTrial::GetMode(tab_contents_->profile()) ==
- InstantFieldTrial::INSTANT) {
+ if (mode_ == INSTANT)
delegate_->InstantPreviewFocused();
- }
#endif
}
void InstantController::UpdateIsDisplayable() {
- if (!is_out_of_date_ &&
- InstantFieldTrial::GetMode(tab_contents_->profile()) !=
- InstantFieldTrial::INSTANT) {
- return;
- }
-
bool displayable =
(!is_out_of_date_ && loader_.get() && loader_->ready() &&
loader_->http_status_ok());
- if (displayable == is_displayable_)
+ if (displayable == is_displayable_ || mode_ != INSTANT)
return;
is_displayable_ = displayable;
@@ -488,15 +451,13 @@ void InstantController::UpdateLoader(const TemplateURL* template_url,
bool verbatim,
string16* suggested_text) {
is_out_of_date_ = false;
- const InstantFieldTrial::Mode mode =
- InstantFieldTrial::GetMode(tab_contents_->profile());
- if (mode == InstantFieldTrial::INSTANT)
+ if (mode_ == INSTANT)
loader_->SetOmniboxBounds(omnibox_bounds_);
loader_->Update(tab_contents_, template_url, url, transition_type, user_text,
verbatim, suggested_text);
UpdateIsDisplayable();
- // For the HIDDEN and SILENT field trials, don't send back suggestions.
- if (mode == InstantFieldTrial::HIDDEN || mode == InstantFieldTrial::SILENT)
+ // For the HIDDEN and SILENT modes, don't send back suggestions.
+ if (mode_ == HIDDEN || mode_ == SILENT)
suggested_text->clear();
}
diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h
index 97c4b06..3c461d1 100644
--- a/chrome/browser/instant/instant_controller.h
+++ b/chrome/browser/instant/instant_controller.h
@@ -48,7 +48,22 @@ class InstantController : public InstantLoaderDelegate {
// Duration of the instant animation in which the colors change.
static const int kAutoCommitFadeInTimeMS = 300;
- InstantController(Profile* profile, InstantDelegate* delegate);
+ // InstantController may operate in one of these modes:
+ // INSTANT: The default search engine is preloaded when the omnibox gets
+ // focus. Queries are issued as the user types. Predicted queries are
+ // are inline autocompleted into the omnibox. Result previews are shown.
+ // SUGGEST: Same as INSTANT, without visible previews.
+ // HIDDEN: Same as SUGGEST, without the inline autocompletion.
+ // SILENT: Same as HIDDEN, without issuing queries as the user types. The
+ // query is sent only after the user presses <Enter>.
+ enum Mode {
+ INSTANT,
+ SUGGEST,
+ HIDDEN,
+ SILENT
+ };
+
+ InstantController(Profile* profile, InstantDelegate* delegate, Mode mode);
virtual ~InstantController();
// Registers instant related preferences.
@@ -57,7 +72,7 @@ class InstantController : public InstantLoaderDelegate {
// Records instant metrics.
static void RecordMetrics(Profile* profile);
- // Returns true if instant is enabled.
+ // Returns true if instant is enabled in the given |profile|'s preferences.
static bool IsEnabled(Profile* profile);
// Enables instant.
@@ -264,6 +279,9 @@ class InstantController : public InstantLoaderDelegate {
// The most recent user_text passed to |Update|.
string16 last_user_text_;
+ // See the enum description above.
+ const Mode mode_;
+
DISALLOW_COPY_AND_ASSIGN(InstantController);
};
diff --git a/chrome/browser/instant/instant_field_trial.cc b/chrome/browser/instant/instant_field_trial.cc
deleted file mode 100644
index 2540c1b..0000000
--- a/chrome/browser/instant/instant_field_trial.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) 2012 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 "base/command_line.h"
-#include "base/metrics/field_trial.h"
-#include "chrome/browser/metrics/metrics_service.h"
-#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/metrics/experiments_helper.h"
-#include "chrome/common/metrics/variation_ids.h"
-#include "chrome/common/pref_names.h"
-
-namespace {
-
-// IDs of the field trial groups. Though they are not literally "const", they
-// are set only once, in Activate() below.
-int g_instant = 0;
-int g_suggest = 0;
-int g_hidden = 0;
-int g_silent = 0;
-int g_control = 0;
-
-}
-
-// static
-void InstantFieldTrial::Activate() {
- scoped_refptr<base::FieldTrial> trial(
- base::FieldTrialList::FactoryGetFieldTrial(
- "Instant", 1000, "CONTROL", 2013, 7, 1, &g_control));
-
- // Try to give the user a consistent experience, if possible.
- if (base::FieldTrialList::IsOneTimeRandomizationEnabled())
- trial->UseOneTimeRandomization();
-
- // Though each group (including CONTROL) is nominally at 20%, GetMode()
- // often returns SILENT. See below for details.
- g_instant = trial->AppendGroup("INSTANT", 200); // 20%
- g_suggest = trial->AppendGroup("SUGGEST", 200); // 20%
- g_hidden = trial->AppendGroup("HIDDEN", 200); // 20%
- g_silent = trial->AppendGroup("SILENT", 200); // 20%
-
- // Mark these groups in requests to Google.
- experiments_helper::AssociateGoogleVariationID(
- "Instant", "CONTROL", chrome_variations::kInstantIDControl);
- experiments_helper::AssociateGoogleVariationID(
- "Instant", "SILENT", chrome_variations::kInstantIDSilent);
- experiments_helper::AssociateGoogleVariationID(
- "Instant", "HIDDEN", chrome_variations::kInstantIDHidden);
- experiments_helper::AssociateGoogleVariationID(
- "Instant", "SUGGEST", chrome_variations::kInstantIDSuggest);
- experiments_helper::AssociateGoogleVariationID(
- "Instant", "INSTANT", chrome_variations::kInstantIDInstant);
-}
-
-// static
-InstantFieldTrial::Mode InstantFieldTrial::GetMode(Profile* profile) {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kInstantFieldTrial)) {
- std::string switch_value =
- command_line->GetSwitchValueASCII(switches::kInstantFieldTrial);
- if (switch_value == switches::kInstantFieldTrialInstant)
- return INSTANT;
- if (switch_value == switches::kInstantFieldTrialSuggest)
- return SUGGEST;
- if (switch_value == switches::kInstantFieldTrialHidden)
- return HIDDEN;
- if (switch_value == switches::kInstantFieldTrialSilent)
- return SILENT;
- return CONTROL;
- }
-
- // Instant explicitly enabled in chrome://settings.
- const PrefService* prefs = profile ? profile->GetPrefs() : NULL;
- if (prefs && prefs->GetBoolean(prefs::kInstantEnabled))
- return INSTANT;
-
- const int group = base::FieldTrialList::FindValue("Instant");
- if (group == base::FieldTrial::kNotFinalized || group == g_control)
- return CONTROL;
-
- // HIDDEN, SUGGEST and INSTANT need non-incognito, suggest-enabled, UMA
- // opted-in profiles.
- if (prefs && !profile->IsOffTheRecord() &&
- prefs->GetBoolean(prefs::kSearchSuggestEnabled) &&
- MetricsServiceHelper::IsMetricsReportingEnabled()) {
- if (group == g_hidden)
- return HIDDEN;
- if (group == g_suggest)
- return SUGGEST;
-
- // INSTANT also requires no group policy override and no explicit opt-out.
- if (!prefs->IsManagedPreference(prefs::kInstantEnabled) &&
- !prefs->GetBoolean(prefs::kInstantEnabledOnce)) {
- if (group == g_instant)
- return INSTANT;
- }
- }
-
- // Default is SILENT. This will be returned for most users (for example, even
- // if a user falls into another group, but has suggest or UMA disabled).
- return SILENT;
-}
-
-// static
-std::string InstantFieldTrial::GetModeAsString(Profile* profile) {
- const Mode mode = GetMode(profile);
- switch (mode) {
- case INSTANT: return "_Instant";
- case SUGGEST: return "_Suggest";
- case HIDDEN: return "_Hidden";
- case SILENT: return "_Silent";
- case CONTROL: return std::string();
- }
-
- NOTREACHED();
- return std::string();
-}
diff --git a/chrome/browser/instant/instant_field_trial.h b/chrome/browser/instant/instant_field_trial.h
deleted file mode 100644
index 2dca72c..0000000
--- a/chrome/browser/instant/instant_field_trial.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2012 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, which is in one of these modes:
-//
-// INSTANT: The default search engine is preloaded when the omnibox gets focus.
-// Queries are issued as the user types. Predicted queries are inline
-// autocompleted into the omnibox. Result previews are shown.
-//
-// SUGGEST: Same as INSTANT, without the previews.
-//
-// HIDDEN: Same as SUGGEST, without the inline autocompletion.
-//
-// SILENT: Same as HIDDEN, without issuing queries as the user types. The query
-// is sent only after the user presses <Enter>.
-//
-// CONTROL: Instant is disabled.
-class InstantFieldTrial {
- public:
- enum Mode {
- INSTANT,
- SUGGEST,
- HIDDEN,
- SILENT,
- CONTROL
- };
-
- // Activate the field trial and choose a mode at random. Without this, most
- // calls to GetMode() will return CONTROL. See GetMode() for more details.
- // *** MUST NOT BE CALLED MORE THAN ONCE. ***
- static void Activate();
-
- // Return the field trial mode for this profile. This will usually be the
- // mode selected by Activate(), but can sometimes be different, depending on
- // the profile. See the implementation in the .cc file for specific details.
- static Mode GetMode(Profile* profile);
-
- // Return a string describing the mode. Can be added to histogram names, to
- // split histograms by modes.
- static std::string GetModeAsString(Profile* profile);
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(InstantFieldTrial);
-};
-
-#endif // CHROME_BROWSER_INSTANT_INSTANT_FIELD_TRIAL_H_
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index e6fd151..97da63a 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -475,7 +475,6 @@ class MetricsService
// as a 'friend' below.
class MetricsServiceHelper {
private:
- friend class InstantFieldTrial;
friend bool prerender::IsOmniboxEnabled(Profile* profile);
friend class extensions::ExtensionDownloader;
diff --git a/chrome/browser/resources/options2/browser_options.html b/chrome/browser/resources/options2/browser_options.html
index 7284b53..480d926 100644
--- a/chrome/browser/resources/options2/browser_options.html
+++ b/chrome/browser/resources/options2/browser_options.html
@@ -117,8 +117,6 @@
<div class="checkbox" guest-visibility="disabled">
<label id="instant-label">
<!-- TODO(estade): metric? -->
- <input id="instant-field-trial-control" type="checkbox"
- checked="checked" hidden>
<input id="instant-enabled-control" type="checkbox"
pref="instant.enabled">
<!-- TODO(estade) There's a link in here which should not be inside
diff --git a/chrome/browser/resources/options2/browser_options.js b/chrome/browser/resources/options2/browser_options.js
index 7567ac2..80fa4c4 100644
--- a/chrome/browser/resources/options2/browser_options.js
+++ b/chrome/browser/resources/options2/browser_options.js
@@ -194,14 +194,8 @@ cr.define('options', function() {
}
return true;
};
- $('instant-field-trial-control').onchange = function(evt) {
- 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));
Preferences.getInstance().addEventListener(
'restore_session_state.dialog_shown',
this.onSessionRestoreDialogShownChanged_.bind(this));
@@ -762,28 +756,6 @@ 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) {
- $('instant-enabled-control').hidden = enabled;
- $('instant-field-trial-control').hidden = !enabled;
- $('instant-label').htmlFor = enabled ? 'instant-field-trial-control' :
- 'instant-enabled-control';
- },
-
- /**
* Called when the value of the restore_session_state.dialog_shown
* preference changes.
* @param {Event} event Change event.
@@ -1362,7 +1334,6 @@ cr.define('options', function() {
'setFontSize',
'setGtkThemeButtonEnabled',
'setHighContrastCheckboxState',
- 'setInstantFieldTrialStatus',
'setMetricsReportingCheckboxState',
'setMetricsReportingSettingVisibility',
'setPasswordGenerationSettingVisibility',
diff --git a/chrome/browser/search_engines/search_terms_data.cc b/chrome/browser/search_engines/search_terms_data.cc
index e74b29a..f6d64b7 100644
--- a/chrome/browser/search_engines/search_terms_data.cc
+++ b/chrome/browser/search_engines/search_terms_data.cc
@@ -8,7 +8,7 @@
#include "base/metrics/field_trial.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/google/google_url_tracker.h"
-#include "chrome/browser/instant/instant_field_trial.h"
+#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
@@ -110,8 +110,7 @@ string16 UIThreadSearchTermsData::GetRlzParameterValue() const {
std::string UIThreadSearchTermsData::InstantEnabledParam() const {
DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::UI));
- return InstantFieldTrial::GetMode(profile_) == InstantFieldTrial::INSTANT ?
- "&ion=1" : std::string();
+ return InstantController::IsEnabled(profile_) ? "&ion=1" : std::string();
}
// static
diff --git a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc
index 22f22c7..4ac1a9d 100644
--- a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc
@@ -183,16 +183,13 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, kEnableInstant) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
ASSERT_TRUE(BooleanPrefMatches(prefs::kInstantConfirmDialogShown));
ASSERT_TRUE(BooleanPrefMatches(prefs::kInstantEnabled));
- ASSERT_TRUE(BooleanPrefMatches(prefs::kInstantEnabledOnce));
ChangeBooleanPref(0, prefs::kInstantConfirmDialogShown);
ChangeBooleanPref(0, prefs::kInstantEnabled);
- ChangeBooleanPref(0, prefs::kInstantEnabledOnce);
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
ASSERT_TRUE(BooleanPrefMatches(prefs::kInstantConfirmDialogShown));
ASSERT_TRUE(BooleanPrefMatches(prefs::kInstantEnabled));
- ASSERT_TRUE(BooleanPrefMatches(prefs::kInstantEnabledOnce));
}
// TCM ID - 3611311.
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index de6485e..afa8dc8 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -402,7 +402,6 @@ Browser::Browser(Type type, Profile* profile)
local_pref_registrar_.Init(local_state);
local_pref_registrar_.Add(prefs::kPrintingEnabled, this);
local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this);
- local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this);
local_pref_registrar_.Add(prefs::kInManagedMode, this);
}
@@ -413,7 +412,6 @@ Browser::Browser(Type type, Profile* profile)
profile_pref_registrar_.Add(prefs::kHomePage, this);
profile_pref_registrar_.Add(prefs::kInstantEnabled, this);
profile_pref_registrar_.Add(prefs::kIncognitoModeAvailability, this);
- profile_pref_registrar_.Add(prefs::kSearchSuggestEnabled, this);
InitCommandState();
BrowserList::AddBrowser(this);
@@ -3853,9 +3851,7 @@ void Browser::Observe(int type,
*content::Details<std::string>(details).ptr();
if (pref_name == prefs::kPrintingEnabled) {
UpdatePrintingState(GetContentRestrictionsForSelectedTab());
- } else if (pref_name == prefs::kInstantEnabled ||
- pref_name == prefs::kMetricsReportingEnabled ||
- pref_name == prefs::kSearchSuggestEnabled) {
+ } else if (pref_name == prefs::kInstantEnabled) {
if (!InstantController::IsEnabled(profile())) {
if (instant()) {
instant()->DestroyPreviewContents();
@@ -4901,7 +4897,8 @@ bool Browser::OpenInstant(WindowOpenDisposition disposition) {
void Browser::CreateInstantIfNecessary() {
if (is_type_tabbed() && InstantController::IsEnabled(profile()) &&
!profile()->IsOffTheRecord()) {
- instant_.reset(new InstantController(profile_, this));
+ instant_.reset(new InstantController(profile_, this,
+ InstantController::INSTANT));
instant_unload_handler_.reset(new InstantUnloadHandler(this));
}
}
diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
index 081078b..511af7d 100644
--- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/custom_home_pages_table_model.h"
#include "chrome/browser/download/download_prefs.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"
@@ -437,10 +436,6 @@ void BrowserOptionsHandler::RegisterMessages() {
base::Bind(&BrowserOptionsHandler::DisableInstant,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
- "getInstantFieldTrialStatus",
- base::Bind(&BrowserOptionsHandler::GetInstantFieldTrialStatus,
- base::Unretained(this)));
- web_ui()->RegisterMessageCallback(
"createProfile",
base::Bind(&BrowserOptionsHandler::CreateProfile,
base::Unretained(this)));
@@ -895,15 +890,6 @@ void BrowserOptionsHandler::ToggleAutoLaunch(const ListValue* args) {
#endif // OS_WIN
}
-void BrowserOptionsHandler::GetInstantFieldTrialStatus(const ListValue* args) {
- Profile* profile = Profile::FromWebUI(web_ui());
- base::FundamentalValue enabled(
- !profile->GetPrefs()->GetBoolean(prefs::kInstantEnabled) &&
- InstantFieldTrial::GetMode(profile) == InstantFieldTrial::INSTANT);
- web_ui()->CallJavascriptFunction("BrowserOptions.setInstantFieldTrialStatus",
- enabled);
-}
-
scoped_ptr<ListValue> BrowserOptionsHandler::GetProfilesInfoList() {
ProfileInfoCache& cache =
g_browser_process->profile_manager()->GetProfileInfoCache();
diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.h b/chrome/browser/ui/webui/options2/browser_options_handler2.h
index 2315fea..d7ddbb0 100644
--- a/chrome/browser/ui/webui/options2/browser_options_handler2.h
+++ b/chrome/browser/ui/webui/options2/browser_options_handler2.h
@@ -109,9 +109,6 @@ class BrowserOptionsHandler
void CheckAutoLaunchCallback(bool is_in_auto_launch_group,
bool will_launch_at_login);
- // Called to request information about the Instant field trial.
- void GetInstantFieldTrialStatus(const base::ListValue* args);
-
// Returns the string ID for the given default browser state.
int StatusStringIdForState(ShellIntegration::DefaultWebClientState state);
diff --git a/chrome/browser/ui/webui/options2/options2_browsertest.js b/chrome/browser/ui/webui/options2/options2_browsertest.js
index 6a049a5..8ac3994 100644
--- a/chrome/browser/ui/webui/options2/options2_browsertest.js
+++ b/chrome/browser/ui/webui/options2/options2_browsertest.js
@@ -33,8 +33,6 @@ OptionsWebUITest.prototype = {
'setObjectPref',
'clearPref',
'coreOptionsUserMetricsAction',
- // TODO(scr): Handle this new message:
- // getInstantFieldTrialStatus: function() {},
]);
// Register stubs for methods expected to be called before/during tests.
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 8f58045..03bcf3d 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1260,8 +1260,6 @@
'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/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c4bdb9f..352c6dd 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -775,18 +775,6 @@ const char kImportFromFile[] = "import-from-file";
// Causes the browser to launch directly in incognito mode.
const char kIncognito[] = "incognito";
-// Controls the Instant field trial. Valid values are defined below. If an
-// unknown value is supplied on the command line, the field trial is disabled.
-const char kInstantFieldTrial[] = "instant-field-trial";
-// The field trial is forced into the HIDDEN group.
-const char kInstantFieldTrialHidden[] = "hidden";
-// The field trial is forced into the INSTANT group.
-const char kInstantFieldTrialInstant[] = "instant";
-// The field trial is forced into the SILENT group.
-const char kInstantFieldTrialSilent[] = "silent";
-// The field trial is forced into the SUGGEST group.
-const char kInstantFieldTrialSuggest[] = "suggest";
-
// URL to use for instant. If specified this overrides the url from the
// TemplateURL.
const char kInstantURL[] = "instant-url";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 0373bf3..d6c7884 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -212,11 +212,6 @@ extern const char kIgnoreGpuBlacklist[];
extern const char kImport[];
extern const char kImportFromFile[];
extern const char kIncognito[];
-extern const char kInstantFieldTrial[];
-extern const char kInstantFieldTrialHidden[];
-extern const char kInstantFieldTrialInstant[];
-extern const char kInstantFieldTrialSilent[];
-extern const char kInstantFieldTrialSuggest[];
extern const char kInstantURL[];
extern const char kKeepAliveForTest[];
extern const char kLoadComponentExtension[];
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 92d38e3..69fa2c2 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -424,9 +424,6 @@ const char kInstantConfirmDialogShown[] = "instant.confirm_dialog_shown";
// Boolean pref indicating if instant is enabled.
const char kInstantEnabled[] = "instant.enabled";
-// Boolean pref indicating if instant was ever enabled.
-const char kInstantEnabledOnce[] = "instant.enabled_once";
-
// Used to migrate preferences from local state to user preferences to
// enable multiple profiles.
// BITMASK with possible values (see browser_prefs.cc for enum):
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index b15f171..0e375a6 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -166,7 +166,6 @@ extern const char kUrlBlacklist[];
extern const char kUrlWhitelist[];
extern const char kInstantConfirmDialogShown[];
extern const char kInstantEnabled[];
-extern const char kInstantEnabledOnce[];
extern const char kMultipleProfilePrefMigration[];
extern const char kNetworkPredictionEnabled[];
extern const char kDefaultAppsInstallState[];
diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc
index 3895ee7..8d460d3 100644
--- a/chrome/test/base/test_launcher_utils.cc
+++ b/chrome/test/base/test_launcher_utils.cc
@@ -72,10 +72,6 @@ void PrepareBrowserCommandLineForTests(CommandLine* command_line) {
command_line->AppendSwitch(switches::kUseMockKeychain);
#endif
- // Disable the Instant field trial, which may cause unexpected page loads.
- if (!command_line->HasSwitch(switches::kInstantFieldTrial))
- command_line->AppendSwitchASCII(switches::kInstantFieldTrial, "disabled");
-
command_line->AppendSwitch(switches::kDisableComponentUpdate);
}