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

Unified Diff: cc/test/layer_tree_test.cc

Issue 400773002: cc: Parameterize the main thread task runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WebView fix. Created 6 years, 5 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/fake_proxy.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_test.cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index e53af8eb482aefaa510ad179be6ca14c74f92367..230614b619d0812c353c86dc83f54bc372a99374 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -53,11 +53,12 @@ class ThreadProxyForTest : public ThreadProxy {
static scoped_ptr<Proxy> Create(
TestHooks* test_hooks,
LayerTreeHost* host,
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
return make_scoped_ptr(
- new ThreadProxyForTest(test_hooks,
- host,
- impl_task_runner)).PassAs<Proxy>();
+ new ThreadProxyForTest(
+ test_hooks, host, main_task_runner, impl_task_runner))
+ .PassAs<Proxy>();
}
virtual ~ThreadProxyForTest() {}
@@ -99,10 +100,10 @@ class ThreadProxyForTest : public ThreadProxy {
ThreadProxyForTest(
TestHooks* test_hooks,
LayerTreeHost* host,
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner)
- : ThreadProxy(host, impl_task_runner),
- test_hooks_(test_hooks) {
- }
+ : ThreadProxy(host, main_task_runner, impl_task_runner),
+ test_hooks_(test_hooks) {}
};
// Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks.
@@ -335,6 +336,7 @@ class LayerTreeHostForTesting : public LayerTreeHost {
TestHooks* test_hooks,
LayerTreeHostClientForTesting* client,
const LayerTreeSettings& settings,
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) {
scoped_ptr<LayerTreeHostForTesting> layer_tree_host(
new LayerTreeHostForTesting(test_hooks, client, settings));
@@ -342,10 +344,11 @@ class LayerTreeHostForTesting : public LayerTreeHost {
layer_tree_host->InitializeForTesting(
ThreadProxyForTest::Create(test_hooks,
layer_tree_host.get(),
+ main_task_runner,
impl_task_runner));
} else {
- layer_tree_host->InitializeForTesting(
- SingleThreadProxy::Create(layer_tree_host.get(), client));
+ layer_tree_host->InitializeForTesting(SingleThreadProxy::Create(
+ layer_tree_host.get(), client, main_task_runner));
}
return layer_tree_host.Pass();
}
@@ -514,6 +517,7 @@ void LayerTreeTest::DoBeginTest() {
this,
client_.get(),
settings_,
+ base::MessageLoopProxy::current(),
impl_thread_ ? impl_thread_->message_loop_proxy() : NULL);
ASSERT_TRUE(layer_tree_host_);
« no previous file with comments | « cc/test/fake_proxy.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698