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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 2270573002: cc: Get rid of LayerTreeHost::output_surface_lost_ state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-caps
Patch Set: lth-outputsurface-lost: android-build-and-earlyout-sooner Created 4 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.cc ('k') | cc/trees/proxy_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index e5e5504a8399842a8fd279cb07f9fbf6b4e6e1c7..3372abf4f1e2228ea73adea5d607aad05166d918 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1545,13 +1545,12 @@ class LayerTreeHostContextTestLoseAfterSendingBeginMainFrame
: public LayerTreeHostContextTest {
protected:
void BeginTest() override {
- deferred_ = false;
PostSetNeedsCommitToMainThread();
}
void WillBeginMainFrame() override {
// Don't begin a frame with a lost surface.
- EXPECT_FALSE(layer_tree_host()->output_surface_lost());
+ EXPECT_FALSE(lost_);
if (deferred_)
return;
@@ -1565,6 +1564,16 @@ class LayerTreeHostContextTestLoseAfterSendingBeginMainFrame
base::Bind(&LayerTreeHostContextTestLoseAfterSendingBeginMainFrame::
LoseContextOnImplThread,
base::Unretained(this)));
+
+ // After the first frame, we will lose the context and then not start
+ // allowing commits until that happens. The 2nd frame should not happen
+ // before DidInitializeOutputSurface occurs.
+ lost_ = true;
+ }
+
+ void DidInitializeOutputSurface() override {
+ EXPECT_TRUE(lost_);
+ lost_ = false;
}
void LoseContextOnImplThread() {
@@ -1578,7 +1587,8 @@ class LayerTreeHostContextTestLoseAfterSendingBeginMainFrame
void AfterTest() override {}
- bool deferred_;
+ bool deferred_ = false;
+ bool lost_ = true;
};
SINGLE_AND_MULTI_THREAD_TEST_F(
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/proxy_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698