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

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

Issue 22945004: InstantExtended: Add new_tab_url to TemplateURL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 4 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') | chrome/browser/search_engines/prepopulated_engines.json » ('j') | 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 b2ba58f67ac1c46d3d4612cd062011adce3a21d7..35de8371c62b6e5e2c8bb1eb019d23d659a24793 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -245,6 +245,7 @@ class SearchTest : public BrowserWithTestWindowTest {
data.SetURL("http://foo.com/url?bar={searchTerms}");
data.instant_url = "http://foo.com/instant?"
"{google:omniboxStartMarginParameter}foo=foo#foo=foo&strk";
+ data.new_tab_url = "http://foo.com/newtab?strk";
data.alternate_urls.push_back("http://foo.com/alt#quux={searchTerms}");
data.search_terms_replacement_key = "strk";
@@ -666,17 +667,29 @@ TEST_F(SearchTest, ShouldShowInstantNTP_Default) {
TEST_F(SearchTest, ShouldShowInstantNTP_DisabledViaFinch) {
EnableInstantExtendedAPIForTesting();
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("InstantExtended",
- "Group1 show_ntp:0"));
+ "Group1 show_ntp:0"));
EXPECT_FALSE(ShouldShowInstantNTP());
}
-TEST_F(SearchTest, ShouldShowInstantNTP_DisabledByInstantNewTabURLSwitch) {
+TEST_F(SearchTest, ShouldShowInstantNTP_DisabledByUseCacheableNTPFinchFlag) {
EnableInstantExtendedAPIForTesting();
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kInstantNewTabURL, "http://example.com/newtab");
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("InstantExtended",
+ "Group1 use_cacheable_ntp:1"));
EXPECT_FALSE(ShouldShowInstantNTP());
}
+TEST_F(SearchTest, ShouldUseCacheableNTP_Default) {
+ EnableInstantExtendedAPIForTesting();
+ EXPECT_FALSE(ShouldUseCacheableNTP());
+}
+
+TEST_F(SearchTest, ShouldUseCacheableNTP_EnabledViaFinch) {
+ EnableInstantExtendedAPIForTesting();
+ ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("InstantExtended",
+ "Group1 use_cacheable_ntp:1"));
+ EXPECT_TRUE(ShouldUseCacheableNTP());
+}
+
TEST_F(SearchTest, IsNTPURL) {
GURL invalid_url;
GURL ntp_url(chrome::kChromeUINewTabURL);
« no previous file with comments | « chrome/browser/search/search.cc ('k') | chrome/browser/search_engines/prepopulated_engines.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698