| Index: cc/trees/layer_tree_host_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
|
| index f4d245b8c706248f267069644382f40b93a61a60..d6fc805d52224553894b6579b2b4aee3497ffb5b 100644
|
| --- a/cc/trees/layer_tree_host_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_unittest.cc
|
| @@ -717,7 +717,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest {
|
| // commit isn't required for updating the current frame time. We can
|
| // only check for this in the multi-threaded case, since in the single-
|
| // threaded case there will always be a commit between consecutive draws.
|
| - if (ImplThread())
|
| + if (HasImplThread())
|
| EXPECT_EQ(0, frame_);
|
| }
|
|
|
| @@ -1625,8 +1625,9 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
|
| }
|
|
|
| void PostEvictTextures() {
|
| - DCHECK(ImplThread());
|
| - ImplThread()->PostTask(
|
| + DCHECK(HasImplThread());
|
| + ImplThreadTaskRunner()->PostTask(
|
| + FROM_HERE,
|
| base::Bind(&LayerTreeHostTestEvictTextures::EvictTexturesOnImplThread,
|
| base::Unretained(this)));
|
| }
|
| @@ -1879,8 +1880,7 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) {
|
| {
|
| FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
|
|
|
| - scoped_ptr<FakeProxy> proxy =
|
| - make_scoped_ptr(new FakeProxy(scoped_ptr<Thread>()));
|
| + scoped_ptr<FakeProxy> proxy(new FakeProxy);
|
| proxy->GetRendererCapabilities().allow_partial_texture_updates = false;
|
| proxy->SetMaxPartialTextureUpdates(5);
|
|
|
| @@ -1898,8 +1898,7 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) {
|
| {
|
| FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
|
|
|
| - scoped_ptr<FakeProxy> proxy =
|
| - make_scoped_ptr(new FakeProxy(scoped_ptr<Thread>()));
|
| + scoped_ptr<FakeProxy> proxy(new FakeProxy);
|
| proxy->GetRendererCapabilities().allow_partial_texture_updates = true;
|
| proxy->SetMaxPartialTextureUpdates(5);
|
|
|
| @@ -1917,8 +1916,7 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) {
|
| {
|
| FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
|
|
|
| - scoped_ptr<FakeProxy> proxy =
|
| - make_scoped_ptr(new FakeProxy(scoped_ptr<Thread>()));
|
| + scoped_ptr<FakeProxy> proxy(new FakeProxy);
|
| proxy->GetRendererCapabilities().allow_partial_texture_updates = true;
|
| proxy->SetMaxPartialTextureUpdates(20);
|
|
|
| @@ -1938,8 +1936,10 @@ TEST(LayerTreeHostTest, PartialUpdatesWithGLRenderer) {
|
| LayerTreeSettings settings;
|
| settings.max_partial_texture_updates = 4;
|
|
|
| - scoped_ptr<LayerTreeHost> host =
|
| - LayerTreeHost::Create(&client, settings, scoped_ptr<Thread>());
|
| + scoped_ptr<LayerTreeHost> host = LayerTreeHost::Create(
|
| + &client,
|
| + settings,
|
| + scoped_refptr<base::SingleThreadTaskRunner>());
|
| EXPECT_TRUE(host->InitializeOutputSurfaceIfNeeded());
|
| EXPECT_EQ(4u, host->settings().max_partial_texture_updates);
|
| }
|
| @@ -1950,8 +1950,10 @@ TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) {
|
| LayerTreeSettings settings;
|
| settings.max_partial_texture_updates = 4;
|
|
|
| - scoped_ptr<LayerTreeHost> host =
|
| - LayerTreeHost::Create(&client, settings, scoped_ptr<Thread>());
|
| + scoped_ptr<LayerTreeHost> host = LayerTreeHost::Create(
|
| + &client,
|
| + settings,
|
| + scoped_refptr<base::SingleThreadTaskRunner>());
|
| EXPECT_TRUE(host->InitializeOutputSurfaceIfNeeded());
|
| EXPECT_EQ(4u, host->settings().max_partial_texture_updates);
|
| }
|
| @@ -1962,8 +1964,10 @@ TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) {
|
| LayerTreeSettings settings;
|
| settings.max_partial_texture_updates = 4;
|
|
|
| - scoped_ptr<LayerTreeHost> host =
|
| - LayerTreeHost::Create(&client, settings, scoped_ptr<Thread>());
|
| + scoped_ptr<LayerTreeHost> host = LayerTreeHost::Create(
|
| + &client,
|
| + settings,
|
| + scoped_refptr<base::SingleThreadTaskRunner>());
|
| EXPECT_TRUE(host->InitializeOutputSurfaceIfNeeded());
|
| EXPECT_EQ(0u, host->settings().max_partial_texture_updates);
|
| }
|
| @@ -1975,8 +1979,10 @@ TEST(LayerTreeHostTest,
|
| LayerTreeSettings settings;
|
| settings.max_partial_texture_updates = 4;
|
|
|
| - scoped_ptr<LayerTreeHost> host =
|
| - LayerTreeHost::Create(&client, settings, scoped_ptr<Thread>());
|
| + scoped_ptr<LayerTreeHost> host = LayerTreeHost::Create(
|
| + &client,
|
| + settings,
|
| + scoped_refptr<base::SingleThreadTaskRunner>());
|
| EXPECT_TRUE(host->InitializeOutputSurfaceIfNeeded());
|
| EXPECT_EQ(0u, host->settings().max_partial_texture_updates);
|
| }
|
| @@ -2257,9 +2263,10 @@ class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
|
| virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
|
| // The BeginFrame notification is turned off now but will get enabled
|
| // once we return. End test while it's enabled.
|
| - ImplThread()->PostTask(base::Bind(
|
| - &LayerTreeHostTestBeginFrameNotification::EndTest,
|
| - base::Unretained(this)));
|
| + ImplThreadTaskRunner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&LayerTreeHostTestBeginFrameNotification::EndTest,
|
| + base::Unretained(this)));
|
| }
|
|
|
| virtual void AfterTest() OVERRIDE {}
|
| @@ -2827,7 +2834,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
|
| static_cast<FakePictureLayerImpl*>(host_impl->RootLayer());
|
| if (!initialized_gl_) {
|
| EXPECT_EQ(1u, layer_impl->append_quads_count());
|
| - ImplThread()->PostTask(base::Bind(
|
| + ImplThreadTaskRunner()->PostTask(FROM_HERE, base::Bind(
|
| &LayerTreeHostTestDeferredInitialize::DeferredInitializeAndRedraw,
|
| base::Unretained(this),
|
| base::Unretained(host_impl)));
|
|
|