1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35

base / task / sequence_manager / test / fake_task.cc [blame]

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/task/sequence_manager/test/fake_task.h"

namespace base {
namespace sequence_manager {

FakeTask::FakeTask() : FakeTask(0 /* task_type */) {}

FakeTask::FakeTask(TaskType task_type)
    : Task(internal::PostedTask(nullptr,
                                OnceClosure(),
                                FROM_HERE,
                                base::TimeDelta(),
                                Nestable::kNestable,
                                task_type),
           EnqueueOrder(),
           EnqueueOrder(),
           TimeTicks(),
           WakeUpResolution::kLow) {}

FakeTaskTiming::FakeTaskTiming() : TaskTiming(false /* has_wall_time */) {}

FakeTaskTiming::FakeTaskTiming(TimeTicks start, TimeTicks end)
    : FakeTaskTiming() {
  has_wall_time_ = true;
  start_time_ = start;
  end_time_ = end;
  state_ = State::Finished;
}

}  // namespace sequence_manager
}  // namespace base