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

Unified Diff: chrome/browser/metrics/rappor/sampling_unittest.cc

Issue 933853003: Identify localhost/ipaddress in RapporSamples (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/metrics/rappor/sampling_unittest.cc
diff --git a/chrome/browser/metrics/rappor/sampling_unittest.cc b/chrome/browser/metrics/rappor/sampling_unittest.cc
index fdaa1ab777afaa972ee6439588173fa6a23116bf..6cb1071cbeb8c474d6775b6dbb754837cc1fe18c 100644
--- a/chrome/browser/metrics/rappor/sampling_unittest.cc
+++ b/chrome/browser/metrics/rappor/sampling_unittest.cc
@@ -19,6 +19,18 @@ TEST(RapporSamplingTest, GetDomainAndRegistrySampleFromGURLTest) {
GURL("chrome-extension://abc1234/foo.html")));
EXPECT_EQ("chrome-search://local-ntp", GetDomainAndRegistrySampleFromGURL(
GURL("chrome-search://local-ntp/local-ntp.html")));
+ EXPECT_EQ("localhost", GetDomainAndRegistrySampleFromGURL(
+ GURL("http://localhost:8000/foo.html")));
+ EXPECT_EQ("localhost", GetDomainAndRegistrySampleFromGURL(
+ GURL("http://127.0.0.1/foo.html")));
+ EXPECT_EQ("ip_address", GetDomainAndRegistrySampleFromGURL(
+ GURL("http://192.168.0.1/foo.html")));
+ EXPECT_EQ("ip_address", GetDomainAndRegistrySampleFromGURL(
+ GURL("http://[2001:db8::1]/")));
+ EXPECT_EQ("", GetDomainAndRegistrySampleFromGURL(
+ GURL("http://www/")));
+ EXPECT_EQ("www.corp", GetDomainAndRegistrySampleFromGURL(
+ GURL("http://www.corp/")));
}
// Make sure recording a sample during tests, when the Rappor service is NULL,
« chrome/browser/metrics/rappor/sampling.cc ('K') | « chrome/browser/metrics/rappor/sampling.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698