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

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

Issue 896713003: Revert of DataReductionProxyStatisticsPrefs should support WeakPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/core/browser/data_reduction_proxy_io_data_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
index a0ebac6458ad83823f8a6fa15f65a2d71a70004a..641f625974aba96811bc24520ff13e61fd2b7c3c 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
@@ -109,8 +109,6 @@
new DataReductionProxyIOData(
Client::UNKNOWN, make_scoped_ptr(statistics_prefs), settings(),
net_log(), message_loop_proxy(), message_loop_proxy()));
- settings()->SetDataReductionProxyStatisticsPrefs(
- io_data->PassStatisticsPrefs());
// Check that io_data creates an interceptor. Such an interceptor is
// thoroughly tested by DataReductionProxyInterceptoTest.
@@ -120,7 +118,13 @@
// At this point io_data->statistics_prefs() should be set and compression
// statistics logging should be enabled.
- EXPECT_EQ(statistics_prefs, settings()->statistics_prefs().get());
+ EXPECT_EQ(statistics_prefs, io_data->statistics_prefs());
+
+ // Check if explicitly enabling compression statistics logging results in
+ // a new logging object being created.
+ io_data->EnableCompressionStatisticsLogging(prefs(), base::TimeDelta());
+ EXPECT_NE(statistics_prefs, io_data->statistics_prefs());
+ EXPECT_TRUE(io_data->statistics_prefs());
// When creating a network delegate, expect that it properly wraps a
// network delegate. Such a network delegate is thoroughly tested by

Powered by Google App Engine
This is Rietveld 408576698