Let MetricsService know about some Android Activities
[chromium-blink-merge.git] / base / test / test_pending_task.cc
blobcb8412c4a559689c20ab4fb4d2103e1bfd1a3b28
1 // Copyright (c) 2012 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.
5 #include "base/test/test_pending_task.h"
7 namespace base {
9 TestPendingTask::TestPendingTask() : nestability(NESTABLE) {}
11 TestPendingTask::TestPendingTask(
12 const tracked_objects::Location& location,
13 const Closure& task,
14 TimeTicks post_time,
15 TimeDelta delay,
16 TestNestability nestability)
17 : location(location),
18 task(task),
19 post_time(post_time),
20 delay(delay),
21 nestability(nestability) {}
23 TimeTicks TestPendingTask::GetTimeToRun() const {
24 return post_time + delay;
27 bool TestPendingTask::ShouldRunBefore(const TestPendingTask& other) const {
28 if (nestability != other.nestability)
29 return (nestability == NESTABLE);
30 return GetTimeToRun() < other.GetTimeToRun();
33 TestPendingTask::~TestPendingTask() {}
35 } // namespace base