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

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

Issue 10644002: Add core plumbing for Instant Extended work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed UI stuff from SearchModel Created 8 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
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 5c0bfbbb5cb68cf1eceb6d00cbd8e5d7bababddd..04a20f58c924ac253d08650034796aa5a9e33ca3 100644
--- a/chrome/browser/google/google_util_unittest.cc
+++ b/chrome/browser/google/google_util_unittest.cc
@@ -9,6 +9,7 @@
using google_util::IsGoogleDomainUrl;
using google_util::IsGoogleHomePageUrl;
using google_util::IsGoogleSearchUrl;
+using google_util::IsInstantExtendedAPIGoogleSearchUrl;
TEST(GoogleUtilTest, GoodHomePagesNonSecure) {
// Valid home page hosts.
@@ -243,6 +244,33 @@ TEST(GoogleUtilTest, BadSearches) {
"http://www.google.com/WEBHP#q=something"));
}
+TEST(GoogleUtilTest, IsInstantExtendedAPIGoogleSearchUrl) {
+ EXPECT_TRUE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&espv=1"));
+ EXPECT_TRUE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&espv=3"));
+ EXPECT_TRUE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&espv=42"));
+
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&espv="));
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&espv=0"));
+
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.foo.com/search?q=something&espv=0"));
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.foo.com/search?q=something&espv=1"));
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/bing?q=something&espv=1"));
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&vespv=1"));
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search?q=something&espvx=1"));
+ EXPECT_FALSE(IsInstantExtendedAPIGoogleSearchUrl(
+ "http://www.google.com/search#q=something&espv=1"));
+}
+
TEST(GoogleUtilTest, GoogleDomains) {
// Test some good Google domains (valid TLDs).
EXPECT_TRUE(IsGoogleDomainUrl("http://www.google.com",

Powered by Google App Engine
This is Rietveld 408576698