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

Unified Diff: components/metrics/metrics_reporting_scheduler_unittest.cc

Issue 922383003: Enable UMA log uploads for cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for IOS 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/metrics/metrics_reporting_scheduler_unittest.cc
diff --git a/components/metrics/metrics_reporting_scheduler_unittest.cc b/components/metrics/metrics_reporting_scheduler_unittest.cc
index ee80cc74eac3edb90592ee96ab233000c5b89804..2a8e7fafa0f546fd78e3f985eadedab861c2bf8d 100644
--- a/components/metrics/metrics_reporting_scheduler_unittest.cc
+++ b/components/metrics/metrics_reporting_scheduler_unittest.cc
@@ -22,6 +22,11 @@ class MetricsReportingSchedulerTest : public testing::Test {
base::Unretained(this));
}
+ base::Callback<void(bool*)> GetConnectionCallback() {
+ return base::Bind(&MetricsReportingSchedulerTest::SetConnectionTypeCallback,
+ base::Unretained(this));
+ }
+
int callback_call_count() const { return callback_call_count_; }
private:
@@ -29,6 +34,10 @@ class MetricsReportingSchedulerTest : public testing::Test {
++callback_call_count_;
}
+ void SetConnectionTypeCallback(bool* is_cellular_out) {
+ *is_cellular_out = false;
+ }
+
int callback_call_count_;
base::MessageLoopForUI message_loop_;
@@ -38,7 +47,7 @@ class MetricsReportingSchedulerTest : public testing::Test {
TEST_F(MetricsReportingSchedulerTest, InitTaskCompleteBeforeTimer) {
- MetricsReportingScheduler scheduler(GetCallback());
+ MetricsReportingScheduler scheduler(GetCallback(), GetConnectionCallback());
scheduler.SetUploadIntervalForTesting(base::TimeDelta());
scheduler.InitTaskComplete();
scheduler.Start();
@@ -49,7 +58,7 @@ TEST_F(MetricsReportingSchedulerTest, InitTaskCompleteBeforeTimer) {
}
TEST_F(MetricsReportingSchedulerTest, InitTaskCompleteAfterTimer) {
- MetricsReportingScheduler scheduler(GetCallback());
+ MetricsReportingScheduler scheduler(GetCallback(), GetConnectionCallback());
scheduler.SetUploadIntervalForTesting(base::TimeDelta());
scheduler.Start();
base::RunLoop().RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698