Chromium Code Reviews| 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 d1337cb99042ef9b839698dad997d09fd37cbf64..cf74b8c85c2a6c34f82857aab1471d9d89347e4b 100644 |
| --- a/cc/trees/layer_tree_host_unittest_context.cc |
| +++ b/cc/trees/layer_tree_host_unittest_context.cc |
| @@ -999,11 +999,6 @@ class LayerTreeHostContextTestDontUseLostResources |
| DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
| LayerTreeHostImpl::FrameData* frame, |
| DrawResult draw_result) override { |
| - if (host_impl->active_tree()->source_frame_number() == 2) { |
| - // Lose the context during draw on the second commit. This will cause |
| - // a third commit to recover. |
| - context3d_->set_times_bind_texture_succeeds(0); |
| - } |
|
sohanjg_
2017/05/11 14:47:21
This was causing the context loss cb to be execute
|
| return draw_result; |
| } |
| @@ -1019,6 +1014,13 @@ class LayerTreeHostContextTestDontUseLostResources |
| void DidCommitAndDrawFrame() override { |
| ASSERT_TRUE(layer_tree_host()->hud_layer()); |
| + |
| + if (layer_tree_host()->SourceFrameNumber() == 2) { |
| + // Lose the context after draw on the second commit. This will cause |
| + // a third commit to recover. |
| + context3d_->set_times_bind_texture_succeeds(0); |
| + } |
| + |
| // End the test once we know the 3nd frame drew. |
| if (layer_tree_host()->SourceFrameNumber() < 5) { |
| layer_tree_host()->root_layer()->SetNeedsDisplay(); |