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..5d29a821022a402e22f0c0d6f9ff22eb7c54801c 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_); |
+ // The single thread proxy notifies the layer tree host of surface loss |
+ // after the commit is complete. So the commit number is 1 more than in the |
+ // multithreaded case. |
+ if (HasImplThread()) |
+ EXPECT_EQ(2, num_activates_); |
+ else |
+ 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_); |
+ // The single thread proxy notifies the layer tree host of surface loss |
+ // after the commit is complete. So the commit number is 1 more than in the |
+ // multithreaded case. |
+ if (HasImplThread()) |
+ EXPECT_EQ(2, num_activates_); |
+ else |
+ EXPECT_EQ(3, num_activates_); |
// Resources should have gotten cleared after the context was lost. |
EXPECT_EQ(0U, delegated_impl->Resources().size()); |
} |