diff options
author | mariakhomenko <mariakhomenko@chromium.org> | 2015-08-10 08:26:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-10 15:26:48 +0000 |
commit | 49a6f9fff8dbb0fb2a53025afa818e1e6f372d74 (patch) | |
tree | e0232f38f2478941569e2f9c0878e4975e23df86 /components/search | |
parent | 671ffa29267a22bb4c49d71abc845145871bad29 (diff) | |
download | chromium_src-49a6f9fff8dbb0fb2a53025afa818e1e6f372d74.zip chromium_src-49a6f9fff8dbb0fb2a53025afa818e1e6f372d74.tar.gz chromium_src-49a6f9fff8dbb0fb2a53025afa818e1e6f372d74.tar.bz2 |
Turn off query in the omnibox.
Turns off the functionality for Android and iOS.
BUG=517297
Review URL: https://codereview.chromium.org/1270343005
Cr-Commit-Position: refs/heads/master@{#342620}
Diffstat (limited to 'components/search')
-rw-r--r-- | components/search/search.cc | 2 | ||||
-rw-r--r-- | components/search/search_android_unittest.cc | 83 |
2 files changed, 3 insertions, 82 deletions
diff --git a/components/search/search.cc b/components/search/search.cc index 654ec55..1d0d6ada 100644 --- a/components/search/search.cc +++ b/components/search/search.cc @@ -178,7 +178,7 @@ std::string ForceInstantResultsParam(bool for_prerender) { bool IsQueryExtractionEnabled() { #if defined(OS_IOS) || defined(OS_ANDROID) - return true; + return false; #else if (!IsInstantExtendedAPIEnabled()) return false; diff --git a/components/search/search_android_unittest.cc b/components/search/search_android_unittest.cc index f5c8320..a778e7d 100644 --- a/components/search/search_android_unittest.cc +++ b/components/search/search_android_unittest.cc @@ -27,87 +27,8 @@ TEST(SearchTest, EmbeddedSearchAPIEnabled) { } TEST(SearchTest, QueryExtractionEnabled) { - // Query extraction is always enabled on mobile. - EXPECT_TRUE(IsQueryExtractionEnabled()); -} - -class SearchUtilTest : public testing::Test { - protected: - void SetUp() override { - field_trial_list_.reset( - new base::FieldTrialList(new metrics::SHA1EntropyProvider("42"))); - base::StatisticsRecorder::Initialize(); - } - - private: - scoped_ptr<base::FieldTrialList> field_trial_list_; -}; - -TEST_F(SearchUtilTest, UseDefaultEmbeddedSearchPageVersion) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:-1 query_extraction:1")); - EXPECT_TRUE(IsQueryExtractionEnabled()); - EXPECT_EQ("espv=1&", InstantExtendedEnabledParam(true)); - EXPECT_EQ("espv=1&", InstantExtendedEnabledParam(false)); -} - -TEST_F(SearchUtilTest, ShouldPrefetchSearchResults_InstantExtendedAPIEnabled) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 prefetch_results:1")); - EXPECT_TRUE(ShouldPrefetchSearchResults()); - EXPECT_TRUE(IsInstantExtendedAPIEnabled()); - EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); -} - -TEST_F(SearchUtilTest, ShouldPrefetchSearchResults_InstantExtendedAPIDisabled) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:1 prefetch_results:1")); - EXPECT_FALSE(ShouldPrefetchSearchResults()); - EXPECT_FALSE(IsInstantExtendedAPIEnabled()); - EXPECT_EQ(1ul, EmbeddedSearchPageVersion()); -} - -TEST_F(SearchUtilTest, ShouldPrefetchSearchResults_DisabledViaFieldTrials) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 prefetch_results:0")); - EXPECT_FALSE(ShouldPrefetchSearchResults()); - EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); -} - -TEST_F(SearchUtilTest, ShouldPrefetchSearchResults_EnabledViaCommandLine) { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kPrefetchSearchResults); - // Command-line enable should override Finch. - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", "Group1 espv:2 prefetch_results:0")); - EXPECT_TRUE(ShouldPrefetchSearchResults()); - EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); -} - -TEST_F(SearchUtilTest, - ShouldReuseInstantSearchBasePage_PrefetchResultsFlagDisabled) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", - "Group1 espv:2 prefetch_results:0 reuse_instant_search_base_page:1")); - EXPECT_FALSE(ShouldPrefetchSearchResults()); - EXPECT_FALSE(ShouldReuseInstantSearchBasePage()); - EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); -} - -TEST_F(SearchUtilTest, ShouldReuseInstantSearchBasePage_EnabledViaFieldTrial) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", - "Group1 espv:2 prefetch_results:1 reuse_instant_search_base_page:1")); - EXPECT_TRUE(ShouldReuseInstantSearchBasePage()); - EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); -} - -TEST_F(SearchUtilTest, ShouldReuseInstantSearchBasePage_DisabledViaFieldTrial) { - ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( - "EmbeddedSearch", - "Group1 espv:2 prefetch_results:1 reuse_instant_search_base_page:0")); - EXPECT_FALSE(ShouldReuseInstantSearchBasePage()); - EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); + // Query extraction is disabled on mobile. + EXPECT_FALSE(IsQueryExtractionEnabled()); } } // namespace |