Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3360)

Unified Diff: cc/trees/layer_tree_host_unittest_delegated.cc

Issue 478703002: Remove cc::LayerTreeHostImpl::IsContextLost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctx4
Patch Set: Include all changes. Prev patchset was second stage only Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());
}

Powered by Google App Engine
This is Rietveld 408576698