Chromium Code Reviews| 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..86a58047abb512f6ed42599a9403e1f0c8dac76f 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::IsEmbeddedGoogleSearchUrl; |
| TEST(GoogleUtilTest, GoodHomePagesNonSecure) { |
| // Valid home page hosts. |
| @@ -243,6 +244,30 @@ TEST(GoogleUtilTest, BadSearches) { |
| "http://www.google.com/WEBHP#q=something")); |
| } |
| +TEST(GoogleUtilTest, IsEmbeddedGoogleSearchUrl) { |
| + EXPECT_TRUE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/search?q=something&espv=1")); |
| + EXPECT_TRUE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/search?q=something&espv=3")); |
| + EXPECT_TRUE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/search?q=something&espv=42")); |
| + |
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/search?q=something&espv=")); |
|
Ilya Sherman
2012/06/21 17:46:58
nit: Please also add a test for espv=0 on google.c
dhollowa
2012/06/21 22:16:43
Done.
|
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.foo.com/search?q=something&espv=0")); |
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.foo.com/search?q=something&espv=1")); |
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/bing?q=something&espv=1")); |
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/search?q=something&vespv=1")); |
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "http://www.google.com/search?q=something&espvx=1")); |
| + EXPECT_FALSE(IsEmbeddedGoogleSearchUrl( |
| + "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", |