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

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: minor comment fix 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
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..f775c7e6f89ce4229034810e445affd058244f56 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -829,6 +829,44 @@ TEST(NetUtilTest, IsLocalhostTLD) {
EXPECT_FALSE(IsLocalhost("foo.localhoste"));
}
+TEST(NetUtilTest, GoogleHost) {
+ struct GoogleHostCase {
+ const char* const host;
+ bool expected_output;
+ };
+
+ const GoogleHostCase google_host_cases[] = {
+ {"", false},
+ {"google.com", true},
+ {"youtube.com", true},
+ {"gmail.com", true},
+ {"doubleclick.net", true},
+ {"gstatic.com", true},
+ {"googlevideo.com", true},
+ {"googleusercontent.com", true},
+ {"googlesyndication.com", true},
+ {"google-analytics.com", true},
+ {"googleadservices.com", true},
+ {"googleapis.com", true},
+ {".google.com", true},
+ {".youtube.com", true},
+ {".gmail.com", true},
+ {"a.google.com", true},
+ {"b.youtube.com", true},
+ {"c.gmail.com", true},
+ {"google.coma", false},
+ {"agoogle.com", false},
+ {"oogle.com", false},
+ {"google.co", false},
+ {"oggole.com", false},
+ };
+
+ for (size_t i = 0; i < arraysize(google_host_cases); ++i) {
+ EXPECT_EQ(google_host_cases[i].expected_output,
+ IsGoogleHost(google_host_cases[i].host));
+ }
+}
+
// Verify GetNetworkList().
TEST(NetUtilTest, GetNetworkList) {
NetworkInterfaceList list;

Powered by Google App Engine
This is Rietveld 408576698