OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" | 5 #include "components/metrics/metrics_reporting_scheduler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 class MetricsReportingSchedulerTest : public testing::Test { | 13 class MetricsReportingSchedulerTest : public testing::Test { |
14 public: | 14 public: |
15 MetricsReportingSchedulerTest() : callback_call_count_(0) {} | 15 MetricsReportingSchedulerTest() : callback_call_count_(0) {} |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 TEST_F(MetricsReportingSchedulerTest, InitTaskCompleteAfterTimer) { | 49 TEST_F(MetricsReportingSchedulerTest, InitTaskCompleteAfterTimer) { |
50 MetricsReportingScheduler scheduler(GetCallback()); | 50 MetricsReportingScheduler scheduler(GetCallback()); |
51 scheduler.SetUploadIntervalForTesting(base::TimeDelta()); | 51 scheduler.SetUploadIntervalForTesting(base::TimeDelta()); |
52 scheduler.Start(); | 52 scheduler.Start(); |
53 base::RunLoop().RunUntilIdle(); | 53 base::RunLoop().RunUntilIdle(); |
54 EXPECT_EQ(0, callback_call_count()); | 54 EXPECT_EQ(0, callback_call_count()); |
55 | 55 |
56 scheduler.InitTaskComplete(); | 56 scheduler.InitTaskComplete(); |
57 EXPECT_EQ(1, callback_call_count()); | 57 EXPECT_EQ(1, callback_call_count()); |
58 } | 58 } |
OLD | NEW |