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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2398283002: Fix flakiness in LayerTreeHostCacheBehaviorOnOutputSurfaceRecreated (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | 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 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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698