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

Unified Diff: chrome/browser/net/chrome_network_delegate_unittest.cc

Issue 2399783003: Split the data use into foreground, background and unknown (Closed)
Patch Set: Addressed kundaji comments Created 4 years, 2 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 | « no previous file | components/data_use_measurement/content/data_use_measurement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate_unittest.cc
diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc
index 394b23b1220d6a4e98708de8dd00e85e5e421955..47e3ca8ac17fed75767fd20b88403d37379ca2f2 100644
--- a/chrome/browser/net/chrome_network_delegate_unittest.cc
+++ b/chrome/browser/net/chrome_network_delegate_unittest.cc
@@ -222,12 +222,16 @@ TEST_F(ChromeNetworkDelegateTest, DataUseMeasurementServiceTest) {
// A query from a service without redirection.
RequestURL(context(), socket_factory(), false, false);
- histogram_tester.ExpectTotalCount(
- "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 1);
+ EXPECT_FALSE(
+ histogram_tester
+ .GetTotalCountsForPrefix(
+ "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular")
+ .empty());
histogram_tester.ExpectTotalCount(
"DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 1);
- // One upload and one download message, so totalCount should be 2.
- histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 2);
+ EXPECT_FALSE(histogram_tester
+ .GetTotalCountsForPrefix("DataUse.MessageSize.Suggestions")
+ .empty());
histogram_tester.ExpectTotalCount(
"DataUse.TrafficSize.User.Downstream.Foreground.NotCellular", 0);
histogram_tester.ExpectTotalCount(
@@ -244,8 +248,11 @@ TEST_F(ChromeNetworkDelegateTest, DataUseMeasurementUserTest) {
// A query from user without redirection.
RequestURL(context(), socket_factory(), true, false);
- histogram_tester.ExpectTotalCount(
- "DataUse.TrafficSize.User.Downstream.Foreground.NotCellular", 1);
+ EXPECT_FALSE(
+ histogram_tester
+ .GetTotalCountsForPrefix(
+ "DataUse.TrafficSize.User.Downstream.Foreground.NotCellular")
+ .empty());
histogram_tester.ExpectTotalCount(
"DataUse.TrafficSize.User.Upstream.Foreground.NotCellular", 1);
histogram_tester.ExpectTotalCount(
@@ -266,12 +273,17 @@ TEST_F(ChromeNetworkDelegateTest, DataUseMeasurementServiceTestWithRedirect) {
// A query from user with one redirection.
RequestURL(context(), socket_factory(), false, true);
- histogram_tester.ExpectTotalCount(
- "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular", 2);
+ EXPECT_FALSE(
+ histogram_tester
+ .GetTotalCountsForPrefix(
+ "DataUse.TrafficSize.System.Downstream.Foreground.NotCellular")
+ .empty());
histogram_tester.ExpectTotalCount(
"DataUse.TrafficSize.System.Upstream.Foreground.NotCellular", 2);
// Two uploads and two downloads message, so totalCount should be 4.
- histogram_tester.ExpectTotalCount("DataUse.MessageSize.Suggestions", 4);
+ EXPECT_FALSE(histogram_tester
+ .GetTotalCountsForPrefix("DataUse.MessageSize.Suggestions")
+ .empty());
histogram_tester.ExpectTotalCount(
"DataUse.TrafficSize.User.Downstream.Foreground.NotCellular", 0);
histogram_tester.ExpectTotalCount(
@@ -289,8 +301,11 @@ TEST_F(ChromeNetworkDelegateTest, DataUseMeasurementUserTestWithRedirect) {
// A query from user with one redirection.
RequestURL(context(), socket_factory(), true, true);
- histogram_tester.ExpectTotalCount(
- "DataUse.TrafficSize.User.Downstream.Foreground.NotCellular", 2);
+ EXPECT_FALSE(
+ histogram_tester
+ .GetTotalCountsForPrefix(
+ "DataUse.TrafficSize.User.Downstream.Foreground.NotCellular")
+ .empty());
histogram_tester.ExpectTotalCount(
"DataUse.TrafficSize.User.Upstream.Foreground.NotCellular", 2);
histogram_tester.ExpectTotalCount(
« no previous file with comments | « no previous file | components/data_use_measurement/content/data_use_measurement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698