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

Unified Diff: cc/test/scheduler_test_common.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 years, 2 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/scheduler_test_common.h ('k') | cc/test/test_webkit_platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/scheduler_test_common.cc
diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc
index b2bedd86fd942c95563403789eba949796638f3c..4d2c13c0db6ce40dbaf13b57df0129efa01ea9fe 100644
--- a/cc/test/scheduler_test_common.cc
+++ b/cc/test/scheduler_test_common.cc
@@ -24,24 +24,31 @@ FakeThread::~FakeThread()
{
}
-void FakeThread::postTask(PassOwnPtr<Task>)
+void FakeThread::runPendingTask()
{
- NOTREACHED();
+ ASSERT_TRUE(m_pendingTask);
+ scoped_ptr<base::Closure> task = m_pendingTask.Pass();
+ task->Run();
}
-void FakeThread::postDelayedTask(PassOwnPtr<Task> task, long long delay)
+void FakeThread::postTask(base::Closure cb)
+{
+ postDelayedTask(cb, 0);
+}
+
+void FakeThread::postDelayedTask(base::Closure cb, long long delay)
{
if (m_runPendingTaskOnOverwrite && hasPendingTask())
runPendingTask();
- EXPECT_TRUE(!hasPendingTask());
- m_pendingTask = task;
+ ASSERT_FALSE(hasPendingTask());
+ m_pendingTask.reset(new base::Closure(cb));
m_pendingTaskDelay = delay;
}
-base::PlatformThreadId FakeThread::threadID() const
+bool FakeThread::belongsToCurrentThread() const
{
- return 0;
+ return true;
}
void FakeTimeSource::setClient(cc::TimeSourceClient* client)
« no previous file with comments | « cc/test/scheduler_test_common.h ('k') | cc/test/test_webkit_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698