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

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

Issue 150033002: NTP: add histogram to track New Tab page URL status. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 11 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') | tools/metrics/histograms/histograms.xml » ('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 6d76b0a8dce01d14a886f802485d0485e35ce806..ac18957c7a931acbfbbe6062b0b7c245ed20fdf1 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -521,9 +521,12 @@ TEST_F(SearchTest, InstantCacheableNTPNavigationEntryNewProfile) {
controller.GetLastCommittedEntry()));
}
-TEST_F(SearchTest, UseLocalNTPInIncognito) {
- EXPECT_EQ(GURL(), chrome::GetNewTabPageURL(
- profile()->GetOffTheRecordProfile()));
+TEST_F(SearchTest, NoRewriteInIncognito) {
+ profile()->ForceIncognito(true);
+ EXPECT_EQ(GURL(), chrome::GetNewTabPageURL(profile()));
+ GURL new_tab_url(chrome::kChromeUINewTabURL);
+ EXPECT_FALSE(HandleNewTabURLRewrite(&new_tab_url, profile()));
+ EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), new_tab_url);
}
TEST_F(SearchTest, UseLocalNTPIfNTPURLIsInsecure) {
@@ -531,6 +534,9 @@ TEST_F(SearchTest, UseLocalNTPIfNTPURLIsInsecure) {
SetSearchProvider(true, true);
EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl),
chrome::GetNewTabPageURL(profile()));
+ GURL new_tab_url(chrome::kChromeUINewTabURL);
+ EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile()));
+ EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url);
}
TEST_F(SearchTest, UseLocalNTPIfNTPURLIsNotSet) {
@@ -538,6 +544,9 @@ TEST_F(SearchTest, UseLocalNTPIfNTPURLIsNotSet) {
SetSearchProvider(false, true);
EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl),
chrome::GetNewTabPageURL(profile()));
+ GURL new_tab_url(chrome::kChromeUINewTabURL);
+ EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile()));
+ EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url);
}
TEST_F(SearchTest, UseLocalNTPIfNTPURLIsBlockedForSupervisedUser) {
@@ -552,6 +561,9 @@ TEST_F(SearchTest, UseLocalNTPIfNTPURLIsBlockedForSupervisedUser) {
EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl),
chrome::GetNewTabPageURL(profile()));
+ GURL new_tab_url(chrome::kChromeUINewTabURL);
+ EXPECT_TRUE(HandleNewTabURLRewrite(&new_tab_url, profile()));
+ EXPECT_EQ(GURL(chrome::kChromeSearchLocalNtpUrl), new_tab_url);
EXPECT_EQ(GURL(), GetInstantURL(profile(), kDisableStartMargin, false));
}
« no previous file with comments | « chrome/browser/search/search.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698