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

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

Issue 19872007: Use process per site instance for "Instant". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 5 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/ui/search/instant_extended_interactive_uitest.cc » ('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 b718e068ed4d9eb7553d5e3b49b3a991795aa96f..c9865001b38c27404045d64eb4a248c2ec9f7d14 100644
--- a/chrome/browser/search/search_unittest.cc
+++ b/chrome/browser/search/search_unittest.cc
@@ -290,6 +290,35 @@ TEST_F(SearchTest, ShouldAssignURLToInstantRendererExtendedEnabled) {
}
}
+TEST_F(SearchTest, ShouldUseProcessPerSiteForInstantURL) {
+ EnableInstantExtendedAPIForTesting();
+
+ const SearchTestCase kTestCases[] = {
+ {"chrome-search://local-ntp", true, "Local NTP"},
+ {"chrome-search://online-ntp", true, "Online NTP"},
+ {"invalid-scheme://local-ntp", false, "Invalid Local NTP URL"},
+ {"invalid-scheme://online-ntp", false, "Invalid Online NTP URL"},
+ {"chrome-search://foo.com", false, "Search result page"},
+ {"https://foo.com/instant?strk", false, ""},
+ {"https://foo.com/instant#strk", false, ""},
+ {"https://foo.com/instant?strk=0", false, ""},
+ {"https://foo.com/url?strk", false, ""},
+ {"https://foo.com/alt?strk", false, ""},
+ {"http://foo.com/instant", false, "Non-HTTPS"},
+ {"http://foo.com/instant?strk", false, "Non-HTTPS"},
+ {"http://foo.com/instant?strk=1", false, "Non-HTTPS"},
+ {"https://foo.com/instant", false, "No search terms replacement"},
+ {"https://foo.com/?strk", false, "Non-exact path"},
+ };
+
+ for (size_t i = 0; i < arraysize(kTestCases); ++i) {
+ const SearchTestCase& test = kTestCases[i];
+ EXPECT_EQ(test.expected_result,
+ ShouldUseProcessPerSiteForInstantURL(GURL(test.url), profile()))
+ << test.url << " " << test.comment;
+ }
+}
+
struct PrivilegedURLTestCase {
bool add_as_alternate_url;
const char* input_url;
« no previous file with comments | « chrome/browser/search/search.cc ('k') | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698