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() {}
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.
virtual void CommitComplete() OVERRIDE {
LayerTreeHostImpl::CommitComplete();
test_hooks_->CommitCompleteOnThread(this);
-
- if (!settings().impl_side_painting) {
- test_hooks_->WillActivateTreeOnThread(this);
- test_hooks_->DidActivateTreeOnThread(this);
- }
}
virtual DrawResult PrepareToDraw(FrameData* frame) OVERRIDE {
}
}
- virtual void ActivatePendingTree() OVERRIDE {
+ virtual void ActivateSyncTree() OVERRIDE {
test_hooks_->WillActivateTreeOnThread(this);
- LayerTreeHostImpl::ActivatePendingTree();
+ LayerTreeHostImpl::ActivateSyncTree();
DCHECK(!pending_tree());
test_hooks_->DidActivateTreeOnThread(this);
}
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));
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();
}
this,
client_.get(),
settings_,
+ base::MessageLoopProxy::current(),
impl_thread_ ? impl_thread_->message_loop_proxy() : NULL);
ASSERT_TRUE(layer_tree_host_);
}
void LayerTreeTest::RealEndTest() {
- if (layer_tree_host_ && proxy()->CommitPendingForTesting()) {
+ if (layer_tree_host_ && !timed_out_ &&
+ proxy()->MainFrameWillHappenForTesting()) {
main_task_runner_->PostTask(
FROM_HERE,
base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_));