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

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..03c967b80bc3f373e3ef2a9d01c994c2d0ca1e93 100644
--- a/chrome/browser/metrics/rappor/sampling_unittest.cc
+++ b/chrome/browser/metrics/rappor/sampling_unittest.cc
@@ -19,6 +19,14 @@ 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]/")));
Nathan Parker 2015/02/18 21:56:46 While you're here, add two more: http://www/ -->
Steven Holte 2015/02/19 23:42:19 Done, but http://www.corp/ --> "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