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

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

Issue 330653004: Adds a field trial flag to control whether to use an alternate Instant search base page URL for pre… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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
« no previous file with comments | « 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 0bc364015cfabe3a5683db5ea7550479672ae259..be690d3e626b1492272af8e5b034f649ebe7d1f1 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -589,6 +589,13 @@ TEST_F(SearchTest, GetInstantURL) {
// Disable suggest. No Instant URL.
profile()->GetPrefs()->SetBoolean(prefs::kSearchSuggestEnabled, false);
EXPECT_EQ(GURL(), GetInstantURL(profile(), kDisableStartMargin, false));
+
+ // Use alternate Instant search base URL.
+ profile()->GetPrefs()->SetBoolean(prefs::kSearchSuggestEnabled, true);
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ "EmbeddedSearch", "Group1 espv:8 use_alternate_instant_url:1"));
+ EXPECT_EQ(GURL("https://foo.com/search?foo=foo&qbp=1#foo=foo&strk"),
+ GetInstantURL(profile(), kDisableStartMargin, false));
}
TEST_F(SearchTest, StartMarginCGI) {
@@ -724,6 +731,18 @@ TEST_F(SearchTest, ShouldAllowPrefetchNonDefaultMatch_EnabledViaFieldTrial) {
EXPECT_EQ(80ul, EmbeddedSearchPageVersion());
}
+TEST_F(SearchTest, ShouldUseAltInstantURL_DisabledViaFieldTrial) {
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ "EmbeddedSearch", "Group1 espv:8 use_alternate_instant_url:0"));
+ EXPECT_FALSE(ShouldUseAltInstantURL());
+}
+
+TEST_F(SearchTest, ShouldUseAltInstantURL_EnabledViaFieldTrial) {
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
+ "EmbeddedSearch", "Group1 espv:8 use_alternate_instant_url:1"));
+ EXPECT_TRUE(ShouldUseAltInstantURL());
+}
+
TEST_F(SearchTest,
ShouldPrerenderInstantUrlOnOmniboxFocus_PrefetchResultsFlagDisabled) {
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
« no previous file with comments | « chrome/browser/search/search.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698