Index: chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc |
diff --git a/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc b/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc |
index 2aeed12b04aee21cc490e6d898ac212d76509bf2..34de377662a169ad02b2e39fc84789680339138c 100644 |
--- a/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc |
+++ b/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc |
@@ -66,6 +66,7 @@ class VariationsHttpHeaderProviderTest : public ::testing::Test { |
}; |
TEST_F(VariationsHttpHeaderProviderTest, ShouldAppendHeaders) { |
+ VariationsHttpHeaderProvider provider; |
struct { |
const char* url; |
bool should_append_headers; |
@@ -92,7 +93,8 @@ TEST_F(VariationsHttpHeaderProviderTest, ShouldAppendHeaders) { |
{ "http://ad.doubleclick.net", true }, |
{ "https://a.b.c.doubleclick.net", true }, |
{ "https://a.b.c.doubleclick.net:8081", true }, |
- { "http://www.doubleclick.com", false }, |
+ { "http://www.doubleclick.com", true }, |
+ { "http://www.doubleclick.org", false }, |
{ "http://www.doubleclick.net.com", false }, |
{ "https://www.doubleclick.net.com", false }, |
@@ -106,16 +108,57 @@ TEST_F(VariationsHttpHeaderProviderTest, ShouldAppendHeaders) { |
{ "http://www.googleadservices.com", true }, |
{ "http://www.googleadservices.com:8080", true }, |
{ "https://www.googleadservices.com", true }, |
- { "https://www.internal.googleadservices.com", false }, |
- { "https://www2.googleadservices.com", false }, |
+ { "https://www.internal.googleadservices.com", true }, |
+ { "https://www2.googleadservices.com", true }, |
{ "https://www.googleadservices.org", false }, |
{ "https://www.googleadservices.com.co.uk", false }, |
+ |
+ { "http://WWW.ANDROID.COM", true }, |
avd
2014/05/29 23:38:20
thanks for adding a test case with mixed case.
Ryan Hamilton
2014/05/29 23:48:38
My pleasure!
|
+ { "http://www.android.com", true }, |
+ { "http://www.doubleclick.com", true }, |
+ { "http://www.doubleclick.net", true }, |
+ { "http://www.ggpht.com", true }, |
+ { "http://www.googleadservices.com", true }, |
+ { "http://www.googleapis.com", true }, |
+ { "http://www.googlesyndication.com", true }, |
+ { "http://www.googleusercontent.com", true }, |
+ { "http://www.googlevideo.com", true }, |
+ { "http://ssl.gstatic.com", true }, |
+ { "http://www.gstatic.com", true }, |
+ { "http://www.ytimg.com", true }, |
avd
2014/05/29 23:38:20
+ { "http://wwwytimg.com", false },
+ { "htt
Ryan Hamilton
2014/05/29 23:48:38
Done.
|
+ |
+ { "http://www.android.org", false }, |
+ { "http://www.doubleclick.org", false }, |
+ { "http://www.doubleclick.net", true }, |
+ { "http://www.ggpht.org", false }, |
+ { "http://www.googleadservices.org", false }, |
+ { "http://www.googleapis.org", false }, |
+ { "http://www.googlesyndication.org", false }, |
+ { "http://www.googleusercontent.org", false }, |
+ { "http://www.googlevideo.org", false }, |
+ { "http://ssl.gstatic.org", false }, |
+ { "http://www.gstatic.org", false }, |
+ { "http://www.ytimg.org", false }, |
+ |
+ { "http://a.b.android.com", true }, |
+ { "http://a.b.doubleclick.com", true }, |
+ { "http://a.b.doubleclick.net", true }, |
+ { "http://a.b.ggpht.com", true }, |
+ { "http://a.b.googleadservices.com", true }, |
+ { "http://a.b.googleapis.com", true }, |
+ { "http://a.b.googlesyndication.com", true }, |
+ { "http://a.b.googleusercontent.com", true }, |
+ { "http://a.b.googlevideo.com", true }, |
+ { "http://ssl.gstatic.com", true }, |
+ { "http://a.b.gstatic.com", true }, |
+ { "http://a.b.ytimg.com", true }, |
+ |
}; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { |
const GURL url(cases[i].url); |
EXPECT_EQ(cases[i].should_append_headers, |
- VariationsHttpHeaderProvider::ShouldAppendHeaders(url)) << url; |
+ provider.ShouldAppendHeaders(url)) << url; |
} |
} |