Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1472)

Unified Diff: cc/test/scheduler_test_common.h

Issue 17362002: cc: Remove FakeThread, use SingleThreadTaskRunner in scheduling classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-fakethread: rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/frame_rate_controller_unittest.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/scheduler_test_common.h
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h
index 8834e62b7db914b8e7b1b9f9acdb4337ce848521..e26802054b263006ccabe8f0d16297b6bf9c2d79 100644
--- a/cc/test/scheduler_test_common.h
+++ b/cc/test/scheduler_test_common.h
@@ -28,53 +28,21 @@ class FakeTimeSourceClient : public cc::TimeSourceClient {
bool tick_called_;
};
-class FakeThread : public cc::Thread {
- public:
- FakeThread();
- virtual ~FakeThread();
-
- void Reset() {
- pending_task_delay_ = 0;
- pending_task_.reset();
- run_pending_task_on_overwrite_ = false;
- }
-
- void RunPendingTaskOnOverwrite(bool enable) {
- run_pending_task_on_overwrite_ = enable;
- }
-
- bool HasPendingTask() const { return pending_task_; }
- void RunPendingTask();
-
- int64 PendingDelayMs() const {
- EXPECT_TRUE(HasPendingTask());
- return pending_task_delay_;
- }
-
- virtual void PostTask(base::Closure cb) OVERRIDE;
- virtual void PostDelayedTask(base::Closure cb, base::TimeDelta delay)
- OVERRIDE;
- virtual bool BelongsToCurrentThread() const OVERRIDE;
-
- protected:
- scoped_ptr<base::Closure> pending_task_;
- int64 pending_task_delay_;
- bool run_pending_task_on_overwrite_;
-};
-
class FakeDelayBasedTimeSource : public cc::DelayBasedTimeSource {
public:
static scoped_refptr<FakeDelayBasedTimeSource> Create(
- base::TimeDelta interval, cc::Thread* thread) {
- return make_scoped_refptr(new FakeDelayBasedTimeSource(interval, thread));
+ base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner) {
+ return make_scoped_refptr(new FakeDelayBasedTimeSource(interval,
+ task_runner));
}
void SetNow(base::TimeTicks time) { now_ = time; }
virtual base::TimeTicks Now() const OVERRIDE;
protected:
- FakeDelayBasedTimeSource(base::TimeDelta interval, cc::Thread* thread)
- : DelayBasedTimeSource(interval, thread) {}
+ FakeDelayBasedTimeSource(base::TimeDelta interval,
+ base::SingleThreadTaskRunner* task_runner)
+ : DelayBasedTimeSource(interval, task_runner) {}
virtual ~FakeDelayBasedTimeSource() {}
base::TimeTicks now_;
« no previous file with comments | « cc/scheduler/frame_rate_controller_unittest.cc ('k') | cc/test/scheduler_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698