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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 311263016: cc: Fix negative EstimatedParentDrawTimes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix flaky LayerTreeHostAnimationTestAddAnimationAfterAnimating Created 6 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') | 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_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 6aaf7cac40c97ebc31854a351f93d928b69b5d83..1542a1417b42e508f348affaee33d551e905246b 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1305,13 +1305,14 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
bool result) OVERRIDE {
- // The third frame is when both animations have started. Check that both
- // have a valid start time.
- if (++num_swap_buffers_ == 3) {
+ // After both animations have started, verify that they have valid
+ // start times.
+ num_swap_buffers_++;
+ AnimationRegistrar::AnimationControllerMap copy =
+ host_impl->animation_registrar()->active_animation_controllers();
+ if (copy.size() == 2u) {
EndTest();
- AnimationRegistrar::AnimationControllerMap copy =
- host_impl->animation_registrar()->active_animation_controllers();
- EXPECT_EQ(2u, copy.size());
+ EXPECT_GE(num_swap_buffers_, 3);
for (AnimationRegistrar::AnimationControllerMap::iterator iter =
copy.begin();
iter != copy.end();
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698