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

Unified Diff: chrome/browser/google/google_util_unittest.cc

Issue 10908226: Introduces a search term extraction mechanism working for arbitrary search providers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 3 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
Index: chrome/browser/google/google_util_unittest.cc
diff --git a/chrome/browser/google/google_util_unittest.cc b/chrome/browser/google/google_util_unittest.cc
index 174b91cd5e91103d3c9eec648767da721702324f..fa3db0ae37aa4c04d1effc65500ad4fef53183a8 100644
--- a/chrome/browser/google/google_util_unittest.cc
+++ b/chrome/browser/google/google_util_unittest.cc
@@ -376,53 +376,3 @@ TEST(GoogleUtilTest, GoogleDomains) {
google_util::DISALLOW_SUBDOMAIN,
google_util::DISALLOW_NON_STANDARD_PORTS));
}
-
-TEST(GoogleUtilTest, SearchTerms) {
- // Simple searches.
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=tractor+supply"));
- EXPECT_EQ(ASCIIToUTF16("tractor supply"),
- google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=tractor+supply&espv=1"));
- // espv=1 only applies in query.
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=potato#espv=1"));
-
- // Instant searches.
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/webhp#q=tractor+supply"));
- EXPECT_EQ(ASCIIToUTF16("tractor supply"),
- google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/webhp?espv=1#q=tractor+supply"));
- // espv=1 only applies in query.
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/webhp?#espv=1&q=potato"));
-
- // Both query and ref components have a search term.
- EXPECT_EQ(ASCIIToUTF16("tractor supply"),
- google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/webhp?q=potato&espv=1#q=tractor+supply"));
-
- // Blank queries.
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=&q=potato&espv=1"));
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/webhp?espv=1#q=&q=tractor+supply"));
-
- // Multiple non-empty queries.
- EXPECT_EQ(ASCIIToUTF16("tractor supply"),
- google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=tractor+supply&q=potato&espv=1"));
- EXPECT_EQ(ASCIIToUTF16("tractor supply"),
- google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/webhp?espv=1#q=tractor+supply&q=potato"));
-
- // Blank terms in ref override non-blank terms in query.
- EXPECT_EQ(string16(), google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=potato&espv=1#q="));
-
- // Blank terms in query do not override non-blank terms in ref.
- EXPECT_EQ(ASCIIToUTF16("tractor supply"),
- google_util::GetSearchTermsFromGoogleSearchURL(
- "http://google.com/search?q=&espv=1#q=tractor+supply"));
-}

Powered by Google App Engine
This is Rietveld 408576698