Chromium Code Reviews| Index: cc/trees/layer_tree_host_unittest_delegated.cc |
| diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc |
| index 1607b71c886f16fbec9424f88ae0db44b7c00714..310d3a9e381e1658093b13dc9c11332620d96916 100644 |
| --- a/cc/trees/layer_tree_host_unittest_delegated.cc |
| +++ b/cc/trees/layer_tree_host_unittest_delegated.cc |
| @@ -352,13 +352,23 @@ class LayerTreeHostDelegatedTestCreateChildId |
| context_provider->ContextGL()->Flush(); |
| break; |
| case 3: |
| - EXPECT_TRUE(delegated_impl->ChildId()); |
| - EXPECT_TRUE(did_reset_child_id_); |
| - EndTest(); |
| + if (HasImplThread()) |
| + CheckForChildResetAndEnd(delegated_impl); |
| + break; |
| + case 4: |
| + if (!HasImplThread()) |
| + CheckForChildResetAndEnd(delegated_impl); |
| break; |
| } |
| } |
| + void CheckForChildResetAndEnd( |
| + FakeDelegatedRendererLayerImpl* delegated_impl) { |
| + EXPECT_TRUE(delegated_impl->ChildId()); |
| + EXPECT_TRUE(did_reset_child_id_); |
| + EndTest(); |
| + } |
| + |
| virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, |
| bool success) OVERRIDE { |
| EXPECT_TRUE(success); |
| @@ -370,7 +380,12 @@ class LayerTreeHostDelegatedTestCreateChildId |
| FakeDelegatedRendererLayerImpl* delegated_impl = |
| static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]); |
| - EXPECT_EQ(2, num_activates_); |
| + if (HasImplThread()) |
|
danakj
2014/08/20 18:22:10
{} because the else needs them
dneto
2014/08/20 19:15:20
Excellent. Control structures without braces freak
|
| + EXPECT_EQ(2, num_activates_); |
| + else |
|
danakj
2014/08/20 18:22:10
{} because the body is more than one line
dneto
2014/08/20 19:15:20
Acknowledged.
|
| + // The single thread proxy issues extra commits after the context is |
| + // lost. http://crbug.com/287250 |
| + EXPECT_EQ(3, num_activates_); |
| EXPECT_FALSE(delegated_impl->ChildId()); |
| did_reset_child_id_ = true; |
| } |
| @@ -445,7 +460,12 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost |
| FakeDelegatedRendererLayerImpl* delegated_impl = |
| static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]); |
| - EXPECT_EQ(2, num_activates_); |
| + if (HasImplThread()) |
|
danakj
2014/08/20 18:22:10
{}
|
| + EXPECT_EQ(2, num_activates_); |
| + else |
|
danakj
2014/08/20 18:22:10
{}
|
| + // The single thread proxy issues extra commits after the context is |
| + // lost. http://crbug.com/287250 |
| + EXPECT_EQ(3, num_activates_); |
| // Resources should have gotten cleared after the context was lost. |
| EXPECT_EQ(0U, delegated_impl->Resources().size()); |
| } |