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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc

Issue 1996513002: Record histograms for DRP secure proxy check failures caused by CPs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@merged_secure_proxy_tests
Patch Set: Rebased on other CL Created 4 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 | « components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
index 4e406689252477edac4b936510813807917923c3..73ad802b7f9369f74e8cf67a910890e7d7f1275d 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <cstdlib>
#include <map>
#include <memory>
#include <utility>
@@ -34,6 +35,7 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/variations/variations_associated_data.h"
#include "net/base/load_flags.h"
+#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
#include "net/log/test_net_log.h"
#include "net/nqe/external_estimate_provider.h"
@@ -130,6 +132,8 @@ class DataReductionProxyConfigTest : public testing::Test {
net::URLRequestStatus status,
SecureProxyCheckFetchResult expected_fetch_result,
const std::vector<net::ProxyServer>& expected_proxies_for_http) {
+ base::HistogramTester histogram_tester;
+
ExpectSecureProxyCheckResult(expected_fetch_result);
TestResponder responder;
responder.response = response;
@@ -142,6 +146,15 @@ class DataReductionProxyConfigTest : public testing::Test {
config()->OnIPAddressChanged();
test_context_->RunUntilIdle();
EXPECT_EQ(expected_proxies_for_http, GetConfiguredProxiesForHttp());
+
+ if (!status.is_success() &&
+ status.error() != net::ERR_INTERNET_DISCONNECTED) {
+ histogram_tester.ExpectUniqueSample("DataReductionProxy.ProbeURLNetError",
+ std::abs(status.error()), 1);
+ } else {
+ histogram_tester.ExpectTotalCount("DataReductionProxy.ProbeURLNetError",
+ 0);
+ }
}
void RunUntilIdle() {
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698