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

Unified Diff: chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc

Issue 1145513004: Record UMA when googlezip proxies are removed from the proxy config. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed to report number of proxies removed Created 5 years, 7 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 | « chrome/browser/net/pref_proxy_config_tracker_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
index 44a3c005b5b9fe396259c820d9726ac9c38d74b4..793e9e7cc0cd06b4b45e46d1f61085fc0fe98674 100644
--- a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
+++ b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc
@@ -11,6 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/testing_pref_service.h"
+#include "base/test/histogram_tester.h"
#include "chrome/browser/prefs/pref_service_mock_factory.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/common/chrome_switches.h"
@@ -310,39 +311,58 @@ TEST_F(PrefProxyConfigTrackerImplTest, ExcludeGooglezipDataReductionProxies) {
"https://proxy.googlezip.net:443,compress.googlezip.net,"
"https://proxy-dev.googlezip.net:443,proxy-dev.googlezip.net,"
"quic://proxy.googlezip.net";
+ const int kNumDataReductionProxies = 5;
struct {
std::string initial_proxy_rules;
const char* http_proxy_info;
const char* https_proxy_info;
const char* ftp_proxy_info;
+ int expected_num_removed_proxies;
} test_cases[] = {
{"http=foopyhttp," + kDataReductionProxies +
",direct://;https=foopyhttps," + kDataReductionProxies +
",direct://;ftp=foopyftp," + kDataReductionProxies + ",direct://",
"foopyhttp;direct://",
"foopyhttps;direct://",
- "foopyftp;direct://"},
+ "foopyftp;direct://",
+ kNumDataReductionProxies * 3},
{"foopy," + kDataReductionProxies + ",direct://",
"foopy;direct://",
"foopy;direct://",
- "foopy;direct://"},
+ "foopy;direct://",
+ kNumDataReductionProxies},
{"http=" + kDataReductionProxies + ";https=" + kDataReductionProxies +
";ftp=" + kDataReductionProxies,
"direct://",
"direct://",
- "direct://"},
+ "direct://",
+ kNumDataReductionProxies * 3},
{"http=" + kDataReductionProxies + ",foopy,direct://",
"foopy;direct://",
"direct://",
- "direct://"},
+ "direct://",
+ kNumDataReductionProxies},
+
+ {"foopy,direct://",
+ "foopy;direct://",
+ "foopy;direct://",
+ "foopy;direct://",
+ 0},
+
+ {"direct://",
+ "direct://",
+ "direct://",
+ "direct://",
+ 0},
};
// Test setting the proxy from a user pref.
for (const auto& test : test_cases) {
+ base::HistogramTester histogram_tester;
pref_service_->SetUserPref(prefs::kProxy,
ProxyConfigDictionary::CreateFixedServers(
test.initial_proxy_rules, std::string()));
@@ -351,6 +371,9 @@ TEST_F(PrefProxyConfigTrackerImplTest, ExcludeGooglezipDataReductionProxies) {
net::ProxyConfig config;
EXPECT_EQ(net::ProxyConfigService::CONFIG_VALID,
proxy_config_service_->GetLatestProxyConfig(&config));
+ histogram_tester.ExpectUniqueSample(
+ "Net.PrefProxyConfig.GooglezipProxyRemovalCount",
+ test.expected_num_removed_proxies, 1);
CheckResolvedProxyMatches(&config, GURL("http://google.com"),
test.http_proxy_info);
« no previous file with comments | « chrome/browser/net/pref_proxy_config_tracker_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698