Index: cc/trees/layer_tree_host_impl_unittest.cc |
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
index 167b65a0a2ecfb629fab2472949b5bc59ddf238a..115c07405001ccc890f5756bd53b21a5be173ca6 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -2128,6 +2128,13 @@ TEST_F(LayerTreeHostImplTest, |
host_impl_->DidDrawAllLayers(frame); |
} |
+TEST_F(LayerTreeHostImplTest, PrepareToDrawFailsWhenSurfaceLost) { |
+ SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1)); |
+ host_impl_->DidLoseOutputSurface(); |
+ LayerTreeHostImpl::FrameData frame; |
+ EXPECT_EQ(DRAW_ABORTED_CONTEXT_LOST, host_impl_->PrepareToDraw(&frame)); |
+} |
+ |
TEST_F(LayerTreeHostImplTest, ScrollRootIgnored) { |
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1); |
root->SetScrollClipLayer(Layer::INVALID_ID); |
@@ -7010,22 +7017,13 @@ class LayerTreeHostImplCountingLostSurfaces : public LayerTreeHostImplTest { |
}; |
TEST_F(LayerTreeHostImplCountingLostSurfaces, TwiceLostSurface) { |
- // The medium term, we plan to remove LayerTreeHostImpl::IsContextLost(). |
- // Until then, we need the state variable |
- // LayerTreeHostImpl::have_valid_output_surface_ and we can |
- // enforce the following behaviour, where calling DidLoseOutputSurface |
- // twice in a row only causes one subsequent |
- // call to LayerTreeHostImplClient::DidLoseOutputSurfaceOnImplThread(). |
// Really we just need at least one client notification each time |
// we go from having a valid output surface to not having a valid output |
// surface. |
EXPECT_EQ(0, num_lost_surfaces_); |
- EXPECT_FALSE(host_impl_->IsContextLost()); |
host_impl_->DidLoseOutputSurface(); |
- EXPECT_TRUE(host_impl_->IsContextLost()); |
EXPECT_EQ(1, num_lost_surfaces_); |
host_impl_->DidLoseOutputSurface(); |
- EXPECT_TRUE(host_impl_->IsContextLost()); |
EXPECT_EQ(1, num_lost_surfaces_); |
} |