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

Unified Diff: net/base/net_util_unittest.cc

Issue 1096783005: QUIC - Collect performance stats for QUIC vs non-QUIC when google (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments for PatchSet 3 Created 5 years, 8 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 | « net/base/net_util.cc ('k') | net/http/http_response_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util_unittest.cc
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
index 5f999afc767bac5ece5ee3576682f521f24f8ad7..0d74cc5444a13abae7c286d61c3fc470a1fcac58 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -829,6 +829,43 @@ TEST(NetUtilTest, IsLocalhostTLD) {
EXPECT_FALSE(IsLocalhost("foo.localhoste"));
}
+TEST(NetUtilTest, GoogleHost) {
+ struct GoogleHostCase {
+ GURL url;
+ bool expected_output;
+ };
+
+ const GoogleHostCase google_host_cases[] = {
+ {GURL("http://.google.com"), true},
+ {GURL("http://.youtube.com"), true},
+ {GURL("http://.gmail.com"), true},
+ {GURL("http://.doubleclick.net"), true},
+ {GURL("http://.gstatic.com"), true},
+ {GURL("http://.googlevideo.com"), true},
+ {GURL("http://.googleusercontent.com"), true},
+ {GURL("http://.googlesyndication.com"), true},
+ {GURL("http://.google-analytics.com"), true},
+ {GURL("http://.googleadservices.com"), true},
+ {GURL("http://.googleapis.com"), true},
+ {GURL("http://a.google.com"), true},
+ {GURL("http://b.youtube.com"), true},
+ {GURL("http://c.gmail.com"), true},
+ {GURL("http://google.com"), false},
+ {GURL("http://youtube.com"), false},
+ {GURL("http://gmail.com"), false},
+ {GURL("http://google.coma"), false},
+ {GURL("http://agoogle.com"), false},
+ {GURL("http://oogle.com"), false},
+ {GURL("http://google.co"), false},
+ {GURL("http://oggole.com"), false},
+ };
+
+ for (size_t i = 0; i < arraysize(google_host_cases); ++i) {
+ EXPECT_EQ(google_host_cases[i].expected_output,
+ HasGoogleHost(google_host_cases[i].url));
+ }
+}
+
// Verify GetNetworkList().
TEST(NetUtilTest, GetNetworkList) {
NetworkInterfaceList list;
« no previous file with comments | « net/base/net_util.cc ('k') | net/http/http_response_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698