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

Unified Diff: cc/trees/layer_tree_host_unittest.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_impl.cc ('k') | cc/trees/layer_tree_host_unittest_context.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.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 363e8e2e204d22348fbae5554081a2b8ade4d013..829812bf152504261352a71d44c4129a910be9c4 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -4871,56 +4871,6 @@ class LayerTreeHostTestBreakSwapPromiseForVisibility
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromiseForVisibility);
-class LayerTreeHostTestBreakSwapPromiseForContext : public LayerTreeHostTest {
- protected:
- LayerTreeHostTestBreakSwapPromiseForContext()
- : output_surface_lost_triggered_(false) {}
-
- void BeginTest() override { PostSetNeedsCommitToMainThread(); }
-
- void LoseOutputSurfaceAndQueueSwapPromise() {
- layer_tree_host()->DidLoseOutputSurface();
- std::unique_ptr<SwapPromise> swap_promise(
- new TestSwapPromise(&swap_promise_result_));
- layer_tree_host()->QueueSwapPromise(std::move(swap_promise));
- }
-
- void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
- const BeginFrameArgs& args) override {
- if (output_surface_lost_triggered_)
- return;
- output_surface_lost_triggered_ = true;
-
- MainThreadTaskRunner()->PostTask(
- FROM_HERE, base::Bind(&LayerTreeHostTestBreakSwapPromiseForContext::
- LoseOutputSurfaceAndQueueSwapPromise,
- base::Unretained(this)));
- }
-
- void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
- CommitEarlyOutReason reason) override {
- // This is needed so that the impl-thread state matches main-thread state.
- host_impl->DidLoseOutputSurface();
- EndTest();
- }
-
- void AfterTest() override {
- {
- base::AutoLock lock(swap_promise_result_.lock);
- EXPECT_FALSE(swap_promise_result_.did_activate_called);
- EXPECT_FALSE(swap_promise_result_.did_swap_called);
- EXPECT_TRUE(swap_promise_result_.did_not_swap_called);
- EXPECT_EQ(SwapPromise::COMMIT_FAILS, swap_promise_result_.reason);
- EXPECT_TRUE(swap_promise_result_.dtor_called);
- }
- }
-
- bool output_surface_lost_triggered_;
- TestSwapPromiseResult swap_promise_result_;
-};
-
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromiseForContext);
-
class SimpleSwapPromiseMonitor : public SwapPromiseMonitor {
public:
SimpleSwapPromiseMonitor(LayerTreeHost* layer_tree_host,
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698