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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 17351017: Re-land: cc: Add raster finished signals to RasterWorkerPool. (Closed) Base URL: http://git.chromium.org/chromium/src.git@new-graph-build
Patch Set: fix flaky unit tests Created 7 years, 6 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_scroll.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 849cb38d62d52d6e23a258dcbd53f4e4d1bc6b04..3b2825cd59534d839b2a0e9c19d98df0000d86eb 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -750,6 +750,14 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
}
virtual bool CanActivatePendingTree(LayerTreeHostImpl* impl) OVERRIDE {
+ if (frame_ >= 1)
+ return true;
+
+ return false;
+ }
+
+ virtual bool CanActivatePendingTreeIfNeeded(LayerTreeHostImpl* impl)
+ OVERRIDE {
frame_++;
if (frame_ == 1) {
first_frame_time_ = impl->CurrentFrameTimeTicks();
@@ -2898,6 +2906,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
virtual void BeginTest() OVERRIDE {
initialized_gl_ = false;
+ num_draws_ = 0;
PostSetNeedsCommitToMainThread();
}
@@ -2922,8 +2931,11 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
base::Unretained(this),
base::Unretained(host_impl)));
} else {
- EXPECT_EQ(2u, layer_impl->append_quads_count());
- EndTest();
+ if (!num_draws_) {
+ EXPECT_EQ(2u, layer_impl->append_quads_count());
+ EndTest();
+ }
+ num_draws_++;
}
}
@@ -2949,6 +2961,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
FakeContentLayerClient client_;
scoped_refptr<FakePictureLayer> layer_;
bool initialized_gl_;
+ int num_draws_;
};
MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize);
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698