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(); |