Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7539)

Unified Diff: chrome/browser/search/search_unittest.cc

Issue 330123003: Set up a field trial flag to prerender Instant search base url on omnibox focus event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/browser/search/search.cc ('K') | « chrome/browser/search/search.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/search_unittest.cc
diff --git a/chrome/browser/search/search_unittest.cc b/chrome/browser/search/search_unittest.cc
index 6e6b6dccd83494e4b0f1109e3797a2b72332f1ca..faf292067ad05c495779d6ba27415dd1828beabd 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -689,6 +689,24 @@ TEST_F(SearchTest, ShouldPrefetchSearchResults_EnabledViaFieldTrial) {
EXPECT_EQ(80ul, EmbeddedSearchPageVersion());
}
+TEST_F(SearchTest,
+ ShouldPrerenderInstantUrlOnOmniboxFocus_DisabledViaFieldTrial) {
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ "EmbeddedSearch",
+ "Group1 espv:89 prerender_instant_url_on_omnibox_focus:0"));
+ EXPECT_FALSE(ShouldPrerenderInstantUrlOnOmniboxFocus());
+ EXPECT_EQ(89ul, EmbeddedSearchPageVersion());
+}
+
+TEST_F(SearchTest,
+ ShouldPrerenderInstantUrlOnOmniboxFocus_EnabledViaFieldTrial) {
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ "EmbeddedSearch",
+ "Group1 espv:80 prerender_instant_url_on_omnibox_focus:1"));
+ EXPECT_TRUE(ShouldPrerenderInstantUrlOnOmniboxFocus());
+ EXPECT_EQ(80ul, EmbeddedSearchPageVersion());
+}
+
TEST_F(SearchTest, ShouldPrefetchSearchResults_EnabledViaCommandLine) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kPrefetchSearchResults);
« chrome/browser/search/search.cc ('K') | « chrome/browser/search/search.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698