summaryrefslogtreecommitdiffstats
path: root/chrome/browser/instant/instant_browsertest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/instant/instant_browsertest.cc')
-rw-r--r--chrome/browser/instant/instant_browsertest.cc179
1 files changed, 0 insertions, 179 deletions
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());
-}