diff options
Diffstat (limited to 'chrome/browser/search/search_unittest.cc')
-rw-r--r-- | chrome/browser/search/search_unittest.cc | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/chrome/browser/search/search_unittest.cc b/chrome/browser/search/search_unittest.cc index a8710dc..0307b3c 100644 --- a/chrome/browser/search/search_unittest.cc +++ b/chrome/browser/search/search_unittest.cc @@ -876,74 +876,4 @@ TEST_F(IsQueryExtractionEnabledTest, EnabledViaCommandLine) { EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); } -typedef SearchTest DisplaySearchButtonTest; - -TEST_F(DisplaySearchButtonTest, NotSet) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_NEVER, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, Never) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 display_search_button:0")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_NEVER, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, CommandLineNever) { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kDisableSearchButtonInOmnibox); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_NEVER, GetDisplaySearchButtonConditions()); - - // Command-line disable should override the field trial. - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 display_search_button:1")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_NEVER, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, ForSearchTermReplacement) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 display_search_button:1")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_FOR_STR, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, CommandLineForSearchTermReplacement) { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableSearchButtonInOmniboxForStr); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_FOR_STR, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, ForSearchTermReplacementOrInputInProgress) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 display_search_button:2")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_FOR_STR_OR_IIP, - GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, - CommandLineForSearchTermReplacementOrInputInProgress) { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableSearchButtonInOmniboxForStrOrIip); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_FOR_STR_OR_IIP, - GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, Always) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 display_search_button:3")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_ALWAYS, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, CommandLineAlways) { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableSearchButtonInOmniboxAlways); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_ALWAYS, GetDisplaySearchButtonConditions()); -} - -TEST_F(DisplaySearchButtonTest, InvalidValue) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 display_search_button:4")); - EXPECT_EQ(DISPLAY_SEARCH_BUTTON_NEVER, GetDisplaySearchButtonConditions()); -} - } // namespace chrome |