Chromium Code Reviews| 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 2a9f8eb9ebd2a5dfe1e1e96e8e031ac7fd0f416a..8bff7b29f028c939ce659e619a8dcf38bcaeb03d 100644 |
| --- a/cc/trees/layer_tree_host_unittest.cc |
| +++ b/cc/trees/layer_tree_host_unittest.cc |
| @@ -580,7 +580,7 @@ class LayerTreeHostCacheBehaviorOnOutputSurfaceRecreated |
| void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, |
| const BeginFrameArgs& args) override { |
| // This code is run once, to trigger recreation of our OutputSurface. |
| - if (has_recreated_) |
| + if (test_state_ != TestState::INIT) |
| return; |
| // Ensure that our initialization expectations have completed. |
| @@ -593,12 +593,13 @@ class LayerTreeHostCacheBehaviorOnOutputSurfaceRecreated |
| EXPECT_CALL(*mock_main_context_support_, |
| SetAggressivelyFreeResources(true)); |
| host_impl->DidLoseCompositorFrameSink(); |
| - has_recreated_ = true; |
| + test_state_ = TestState::RECREATED; |
| } |
| - void DidInitializeCompositorFrameSink() override { |
| + void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, |
| + bool success) override { |
| // This is run after we have recreated our OutputSurface. |
|
danakj
2016/10/06 23:37:38
and here
ericrk
2016/10/07 17:58:31
Done.
|
| - if (!has_recreated_) |
| + if (test_state_ != TestState::RECREATED) |
| return; |
| // Ensure that our initialization expectations have completed. |
| @@ -611,10 +612,12 @@ class LayerTreeHostCacheBehaviorOnOutputSurfaceRecreated |
| EXPECT_CALL(*mock_main_context_support_, |
| SetAggressivelyFreeResources(true)); |
| EndTest(); |
| + test_state_ = TestState::DONE; |
| } |
| private: |
| - bool has_recreated_ = false; |
| + enum class TestState { INIT, RECREATED, DONE }; |
| + TestState test_state_ = TestState::INIT; |
| }; |
| SINGLE_AND_MULTI_THREAD_TEST_F( |