| 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/variations/variations_request_scheduler.h" | 5 #include "chrome/browser/metrics/variations/variations_request_scheduler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace chrome_variations { | 11 namespace chrome_variations { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 void DoNothing() { | 15 void DoNothing() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 } // namespace | 18 } // namespace |
| 19 | 19 |
| 20 TEST(VariationsRequestSchedulerTest, ScheduleFetchShortly) { | 20 TEST(VariationsRequestSchedulerTest, ForceFetch) { |
| 21 base::MessageLoopForUI message_loop_; | 21 base::MessageLoopForUI message_loop_; |
| 22 | 22 |
| 23 const base::Closure task = base::Bind(&DoNothing); | 23 const base::Closure task = base::Bind(&DoNothing); |
| 24 VariationsRequestScheduler scheduler(task); | 24 VariationsRequestScheduler scheduler(task); |
| 25 EXPECT_FALSE(scheduler.one_shot_timer_.IsRunning()); | 25 EXPECT_FALSE(scheduler.one_shot_timer_.IsRunning()); |
| 26 | 26 |
| 27 scheduler.ScheduleFetchShortly(); | 27 scheduler.ForceFetch(); |
| 28 EXPECT_TRUE(scheduler.one_shot_timer_.IsRunning()); | 28 EXPECT_TRUE(scheduler.one_shot_timer_.IsRunning()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace chrome_variations | 31 } // namespace chrome_variations |
| OLD | NEW |