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 b8a2e9cb811d2beee56a29e2a8d8e65ed977e705..55eb956135b8fe8b4c79d8dc00abce546c942f17 100644 |
--- a/cc/trees/layer_tree_host_unittest.cc |
+++ b/cc/trees/layer_tree_host_unittest.cc |
@@ -716,7 +716,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_); |
} |
@@ -1624,8 +1624,9 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { |
} |
void PostEvictTextures() { |
- DCHECK(ImplThread()); |
- ImplThread()->PostTask( |
+ DCHECK(HasImplThread()); |
+ ImplThreadTaskRunner()->PostTask( |
+ FROM_HERE, |
base::Bind(&LayerTreeHostTestEvictTextures::EvictTexturesOnImplThread, |
base::Unretained(this))); |
} |
@@ -1878,8 +1879,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); |
@@ -1897,8 +1897,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); |
@@ -1916,8 +1915,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); |
@@ -1937,8 +1935,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); |
} |
@@ -1949,8 +1949,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); |
} |
@@ -1961,8 +1963,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); |
} |
@@ -1974,8 +1978,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); |
} |
@@ -2267,8 +2273,9 @@ class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest { |
} |
void PostBeginFrameOnImplThread(FakeOutputSurface* fake_output_surface) { |
- DCHECK(ImplThread()); |
- ImplThread()->PostTask( |
+ DCHECK(HasImplThread()); |
+ ImplThreadTaskRunner()->PostTask( |
+ FROM_HERE, |
base::Bind(&LayerTreeHostTestBeginFrameNotification::BeginFrame, |
base::Unretained(this), |
base::Unretained(fake_output_surface))); |
@@ -2308,9 +2315,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 {} |
@@ -2878,7 +2886,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))); |