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

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: Fix style: bracing, no (void) 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest_copyrequest.cc ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « cc/trees/layer_tree_host_unittest_copyrequest.cc ('k') | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698