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..5b0ed2d679ffb39252e999d9a815aab8d0133ac3 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,13 @@ class LayerTreeHostDelegatedTestCreateChildId |
FakeDelegatedRendererLayerImpl* delegated_impl = |
static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]); |
- EXPECT_EQ(2, num_activates_); |
+ if (HasImplThread()) { |
+ EXPECT_EQ(2, num_activates_); |
+ } else { |
+ // 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 +461,13 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost |
FakeDelegatedRendererLayerImpl* delegated_impl = |
static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]); |
- EXPECT_EQ(2, num_activates_); |
+ if (HasImplThread()) { |
+ EXPECT_EQ(2, num_activates_); |
+ } else { |
+ // 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()); |
} |