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

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

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing mmenke comments Created 6 years 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc
index b0b574df9c8c109f9c82a092d8a49545fbe3befc..444ee3978be5eed0aa7f137e0d111aa92a2da485 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics_unittest.cc
@@ -95,9 +95,13 @@ TEST_F(ChromeNetworkDataSavingMetricsTest, TotalLengths) {
const int64 kOriginalLength = 200;
const int64 kReceivedLength = 100;
+ BooleanPrefMember data_reduction_proxy_enabled;
+ data_reduction_proxy_enabled.Init(
+ data_reduction_proxy::prefs::kDataReductionProxyEnabled, &pref_service_);
+
UpdateContentLengthPrefs(
kReceivedLength, kOriginalLength,
- &pref_service_, UNKNOWN_TYPE, statistics_prefs_.get());
+ &data_reduction_proxy_enabled, UNKNOWN_TYPE, statistics_prefs_.get());
EXPECT_EQ(kReceivedLength,
statistics_prefs_->GetInt64(
@@ -111,7 +115,7 @@ TEST_F(ChromeNetworkDataSavingMetricsTest, TotalLengths) {
// Record the same numbers again, and total lengths should be doubled.
UpdateContentLengthPrefs(
kReceivedLength, kOriginalLength,
- &pref_service_, UNKNOWN_TYPE, statistics_prefs_.get());
+ &data_reduction_proxy_enabled, UNKNOWN_TYPE, statistics_prefs_.get());
EXPECT_EQ(kReceivedLength * 2,
statistics_prefs_->GetInt64(
@@ -121,6 +125,7 @@ TEST_F(ChromeNetworkDataSavingMetricsTest, TotalLengths) {
EXPECT_EQ(kOriginalLength * 2,
statistics_prefs_->GetInt64(
data_reduction_proxy::prefs::kHttpOriginalContentLength));
+ data_reduction_proxy_enabled.Destroy();
}
// The initial last update time used in test. There is no leap second a few

Powered by Google App Engine
This is Rietveld 408576698