OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "cc/animation/animation_curve.h" | 7 #include "cc/animation/animation_curve.h" |
8 #include "cc/animation/layer_animation_controller.h" | 8 #include "cc/animation/layer_animation_controller.h" |
9 #include "cc/animation/timing_function.h" | 9 #include "cc/animation/timing_function.h" |
10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 virtual void BeginTest() OVERRIDE { | 263 virtual void BeginTest() OVERRIDE { |
264 PostAddAnimationToMainThread(layer_tree_host()->root_layer()); | 264 PostAddAnimationToMainThread(layer_tree_host()->root_layer()); |
265 } | 265 } |
266 | 266 |
267 // Use WillAnimateLayers to set visible false before the animation runs and | 267 // Use WillAnimateLayers to set visible false before the animation runs and |
268 // causes a commit, so we block the second visible animate in single-thread | 268 // causes a commit, so we block the second visible animate in single-thread |
269 // mode. | 269 // mode. |
270 virtual void WillAnimateLayers( | 270 virtual void WillAnimateLayers( |
271 LayerTreeHostImpl* host_impl, | 271 LayerTreeHostImpl* host_impl, |
272 base::TimeTicks monotonic_time) OVERRIDE { | 272 base::TimeTicks monotonic_time) OVERRIDE { |
| 273 // Verify that the host can draw, it's just not visible. |
| 274 EXPECT_TRUE(host_impl->CanDraw()); |
273 if (num_animates_ < 2) { | 275 if (num_animates_ < 2) { |
274 if (!num_animates_) { | 276 if (!num_animates_) { |
275 // We have a long animation running. It should continue to tick even | 277 // We have a long animation running. It should continue to tick even |
276 // if we are not visible. | 278 // if we are not visible. |
277 PostSetVisibleToMainThread(false); | 279 PostSetVisibleToMainThread(false); |
278 } | 280 } |
279 num_animates_++; | 281 num_animates_++; |
280 return; | 282 return; |
281 } | 283 } |
282 EndTest(); | 284 EndTest(); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 int finished_times_; | 797 int finished_times_; |
796 FakeContentLayerClient client_; | 798 FakeContentLayerClient client_; |
797 scoped_refptr<FakeContentLayer> content_; | 799 scoped_refptr<FakeContentLayer> content_; |
798 }; | 800 }; |
799 | 801 |
800 MULTI_THREAD_TEST_F( | 802 MULTI_THREAD_TEST_F( |
801 LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations); | 803 LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations); |
802 | 804 |
803 } // namespace | 805 } // namespace |
804 } // namespace cc | 806 } // namespace cc |
OLD | NEW |