Add signalSyncPoint to the WebGraphicsContext3D command buffer impls.
[chromium-blink-merge.git] / cc / test / scheduler_test_common.cc
blobc1aa200caabca1fd8474cc277ff9672b38444ec4
1 // Copyright 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 "cc/test/scheduler_test_common.h"
7 #include "base/logging.h"
9 namespace cc {
11 void FakeTimeSourceClient::OnTimerTick() { tick_called_ = true; }
13 FakeThread::FakeThread() { Reset(); }
15 FakeThread::~FakeThread() {}
17 void FakeThread::RunPendingTask() {
18 ASSERT_TRUE(pending_task_);
19 scoped_ptr<base::Closure> task = pending_task_.Pass();
20 task->Run();
23 void FakeThread::PostTask(base::Closure cb) {
24 PostDelayedTask(cb, base::TimeDelta());
27 void FakeThread::PostDelayedTask(base::Closure cb, base::TimeDelta delay) {
28 if (run_pending_task_on_overwrite_ && HasPendingTask())
29 RunPendingTask();
31 ASSERT_FALSE(HasPendingTask());
32 pending_task_.reset(new base::Closure(cb));
33 pending_task_delay_ = delay.InMilliseconds();
36 bool FakeThread::BelongsToCurrentThread() const { return true; }
38 void FakeTimeSource::SetClient(TimeSourceClient* client) { client_ = client; }
40 void FakeTimeSource::SetActive(bool b) { active_ = b; }
42 bool FakeTimeSource::Active() const { return active_; }
44 base::TimeTicks FakeTimeSource::LastTickTime() { return base::TimeTicks(); }
46 base::TimeTicks FakeTimeSource::NextTickTime() { return base::TimeTicks(); }
48 base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; }
50 } // namespace cc