blob: 822c17b2d438eba943251249d3a912eb6d21b63d [file] [log] [blame]
[email protected]e266cd92013-06-20 17:02:021// 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
blundell5f9d1422015-08-17 15:30:215#include "components/variations/variations_request_scheduler.h"
[email protected]e266cd92013-06-20 17:02:026
7#include "base/bind.h"
thestig388327f2015-06-18 19:13:218#include "base/bind_helpers.h"
[email protected]467a106e2013-07-18 12:07:199#include "base/message_loop/message_loop.h"
[email protected]e266cd92013-06-20 17:02:0210#include "testing/gtest/include/gtest/gtest.h"
11
blundell57bcfed2015-09-04 08:44:4512namespace variations {
[email protected]e266cd92013-06-20 17:02:0213
[email protected]e266cd92013-06-20 17:02:0214TEST(VariationsRequestSchedulerTest, ScheduleFetchShortly) {
15 base::MessageLoopForUI message_loop_;
16
thestig388327f2015-06-18 19:13:2117 const base::Closure task = base::Bind(&base::DoNothing);
[email protected]e266cd92013-06-20 17:02:0218 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
blundell57bcfed2015-09-04 08:44:4525} // namespace variations