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

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

Issue 2791563002: Create feature and enable data collection for Data Saver site breakdown (Closed)
Patch Set: sclittle comments Created 3 years, 8 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_compression_stats_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
index 15ab6fc28790821d739144b5a66dfbf6bbbab4e0..3629386e02f59b53730d0c6ffa6e99641038113e 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
@@ -1120,6 +1120,7 @@ TEST_F(DataReductionProxyCompressionStatsTest, DisableDataUsageRecording) {
DisableDataUsageReporting();
base::RunLoop().RunUntilIdle();
+#if !defined(OS_ANDROID)
// Data usage on disk must be deleted.
auto expected_data_usage1 =
base::MakeUnique<std::vector<data_reduction_proxy::DataUsageBucket>>(
@@ -1135,6 +1136,26 @@ TEST_F(DataReductionProxyCompressionStatsTest, DisableDataUsageRecording) {
GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage,
base::Unretained(&verifier2)),
now);
+#else
+ // For Android don't delete data usage.
+ auto expected_data_usage =
+ base::MakeUnique<std::vector<data_reduction_proxy::DataUsageBucket>>(
+ kNumExpectedBuckets);
+ data_reduction_proxy::PerConnectionDataUsage* connection_usage =
+ expected_data_usage->at(kNumExpectedBuckets - 1).add_connection_usage();
+ data_reduction_proxy::PerSiteDataUsage* site_usage =
+ connection_usage->add_site_usage();
+ site_usage->set_hostname("www.foo.com");
+ site_usage->set_data_used(1000);
+ site_usage->set_original_size(1250);
+
+ DataUsageLoadVerifier verifier(std::move(expected_data_usage));
+
+ GetHistoricalDataUsage(base::Bind(&DataUsageLoadVerifier::OnLoadDataUsage,
+ base::Unretained(&verifier)),
+ now);
+#endif
+
base::RunLoop().RunUntilIdle();
}

Powered by Google App Engine
This is Rietveld 408576698