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

Unified Diff: cc/test/test_tile_task_runner.cc

Issue 1997743002: cc: Implement test task runner for tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_schedule_complete
Patch Set: nits Created 4 years, 7 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/test/test_tile_task_runner.h ('k') | cc/tiles/gpu_image_decode_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_tile_task_runner.cc
diff --git a/cc/test/test_tile_task_runner.cc b/cc/test/test_tile_task_runner.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4b5434b28942a0c67a95bef6978aa86c2ab2a2b5
--- /dev/null
+++ b/cc/test/test_tile_task_runner.cc
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/test_tile_task_runner.h"
+
+#include "base/logging.h"
+
+namespace cc {
+
+void TestTileTaskRunner::ProcessTask(TileTask* task) {
+ ScheduleTask(task);
+ RunTask(task);
+ CompleteTask(task);
+}
+
+void TestTileTaskRunner::ScheduleTask(TileTask* task) {
+ DCHECK(task);
+ task->state().DidSchedule();
+}
+
+void TestTileTaskRunner::CancelTask(TileTask* task) {
+ DCHECK(task);
+ task->state().DidCancel();
+}
+
+void TestTileTaskRunner::RunTask(TileTask* task) {
+ DCHECK(task);
+ task->state().DidStart();
+ task->RunOnWorkerThread();
+ task->state().DidFinish();
+}
+
+void TestTileTaskRunner::CompleteTask(TileTask* task) {
+ DCHECK(task);
+ DCHECK(task->state().IsFinished() || task->state().IsCanceled());
+ task->OnTaskCompleted();
+}
+
+} // namespace cc
« no previous file with comments | « cc/test/test_tile_task_runner.h ('k') | cc/tiles/gpu_image_decode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698