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

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

Issue 2365823002: Improve logging of DRP.ConfigService.HTTPRequests (Closed)
Patch Set: Rebased, Addressed megjablon comments Created 4 years, 3 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_delegate.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_delegate_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
index fd0e7641a872828b7bffa2a90ad3fd7711157cfc..6d99189e360f59a2c832395d52c8b5a6cdaf2827 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
@@ -726,6 +726,7 @@ TEST_F(DataReductionProxyDelegateTest, HTTPRequests) {
"http=" + data_reduction_proxy + ",direct://;");
data_reduction_proxy_config.set_id(1);
}
+ EXPECT_NE(test.use_direct_proxy, data_reduction_proxy_config.is_valid());
config()->SetStateForTest(test.enabled_by_user /* enabled */,
false /* at_startup */);
@@ -752,6 +753,7 @@ TEST_F(DataReductionProxyDelegateTest, HTTPRequests) {
}
TEST_F(DataReductionProxyDelegateTest, OnCompletedSizeFor200) {
+ base::HistogramTester histogram_tester;
int64_t baseline_received_bytes = total_received_bytes();
int64_t baseline_original_received_bytes = total_original_received_bytes();
@@ -778,6 +780,9 @@ TEST_F(DataReductionProxyDelegateTest, OnCompletedSizeFor200) {
EXPECT_EQ(static_cast<int64_t>(raw_headers.size() +
10000 /* original_response_body */),
total_original_received_bytes() - baseline_original_received_bytes);
+
+ histogram_tester.ExpectUniqueSample(
+ "DataReductionProxy.ConfigService.HTTPRequests", 1, 1);
}
TEST_F(DataReductionProxyDelegateTest, OnCompletedSizeFor304) {
@@ -912,6 +917,7 @@ TEST_F(DataReductionProxyDelegateTest, PartialRangeSavings) {
};
for (const auto& test : test_cases) {
+ base::HistogramTester histogram_tester;
int64_t baseline_received_bytes = total_received_bytes();
int64_t baseline_original_received_bytes = total_original_received_bytes();
@@ -944,6 +950,8 @@ TEST_F(DataReductionProxyDelegateTest, PartialRangeSavings) {
EXPECT_EQ(expected_original_size, total_original_received_bytes() -
baseline_original_received_bytes)
<< (&test - test_cases);
+ histogram_tester.ExpectUniqueSample(
+ "DataReductionProxy.ConfigService.HTTPRequests", 1, 1);
}
}
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698