[email protected] | e266cd9 | 2013-06-20 17:02:02 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
blundell | 5f9d142 | 2015-08-17 15:30:21 | [diff] [blame^] | 5 | #include "components/variations/variations_request_scheduler.h" |
[email protected] | e266cd9 | 2013-06-20 17:02:02 | [diff] [blame] | 6 | |
7 | #include "base/bind.h" | ||||
thestig | 388327f | 2015-06-18 19:13:21 | [diff] [blame] | 8 | #include "base/bind_helpers.h" |
[email protected] | 467a106e | 2013-07-18 12:07:19 | [diff] [blame] | 9 | #include "base/message_loop/message_loop.h" |
[email protected] | e266cd9 | 2013-06-20 17:02:02 | [diff] [blame] | 10 | #include "testing/gtest/include/gtest/gtest.h" |
11 | |||||
12 | namespace chrome_variations { | ||||
13 | |||||
[email protected] | e266cd9 | 2013-06-20 17:02:02 | [diff] [blame] | 14 | TEST(VariationsRequestSchedulerTest, ScheduleFetchShortly) { |
15 | base::MessageLoopForUI message_loop_; | ||||
16 | |||||
thestig | 388327f | 2015-06-18 19:13:21 | [diff] [blame] | 17 | const base::Closure task = base::Bind(&base::DoNothing); |
[email protected] | e266cd9 | 2013-06-20 17:02:02 | [diff] [blame] | 18 | VariationsRequestScheduler scheduler(task); |
19 | EXPECT_FALSE(scheduler.one_shot_timer_.IsRunning()); | ||||
20 | |||||
21 | scheduler.ScheduleFetchShortly(); | ||||
22 | EXPECT_TRUE(scheduler.one_shot_timer_.IsRunning()); | ||||
23 | } | ||||
24 | |||||
25 | } // namespace chrome_variations |