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

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

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove incorrect DCHECK from drp_statistics_prefs.cc Created 6 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
Index: components/data_reduction_proxy/browser/data_reduction_proxy_metrics_unittest.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics_unittest.cc
index 0d24766d39c9b6322699b7b0693f2b4881a9b8fb..26c07915f2d806908ff8d343577902297811475a 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics_unittest.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics_unittest.cc
@@ -83,6 +83,8 @@ class ChromeNetworkDataSavingMetricsTest : public testing::Test {
registry->RegisterInt64Pref(
data_reduction_proxy::prefs::
kDailyHttpContentLengthLastUpdateDate, 0L);
+ registry->RegisterBooleanPref(
+ data_reduction_proxy::prefs::kDataReductionProxyEnabled, false);
}
TestingPrefServiceSimple pref_service_;
@@ -95,10 +97,13 @@ TEST_F(ChromeNetworkDataSavingMetricsTest, TotalLengths) {
UpdateContentLengthPrefs(
kReceivedLength, kOriginalLength,
- false, UNKNOWN_TYPE, statistics_prefs_.get());
+ &pref_service_, UNKNOWN_TYPE, statistics_prefs_.get());
+
EXPECT_EQ(kReceivedLength,
statistics_prefs_->GetInt64(
data_reduction_proxy::prefs::kHttpReceivedContentLength));
+ EXPECT_FALSE(pref_service_.GetBoolean(
+ data_reduction_proxy::prefs::kDataReductionProxyEnabled));
EXPECT_EQ(kOriginalLength,
statistics_prefs_->GetInt64(
data_reduction_proxy::prefs::kHttpOriginalContentLength));
@@ -106,10 +111,13 @@ TEST_F(ChromeNetworkDataSavingMetricsTest, TotalLengths) {
// Record the same numbers again, and total lengths should be doubled.
UpdateContentLengthPrefs(
kReceivedLength, kOriginalLength,
- false, UNKNOWN_TYPE, statistics_prefs_.get());
+ &pref_service_, UNKNOWN_TYPE, statistics_prefs_.get());
+
EXPECT_EQ(kReceivedLength * 2,
statistics_prefs_->GetInt64(
data_reduction_proxy::prefs::kHttpReceivedContentLength));
+ EXPECT_FALSE(pref_service_.GetBoolean(
+ data_reduction_proxy::prefs::kDataReductionProxyEnabled));
EXPECT_EQ(kOriginalLength * 2,
statistics_prefs_->GetInt64(
data_reduction_proxy::prefs::kHttpOriginalContentLength));

Powered by Google App Engine
This is Rietveld 408576698