diff options
author | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-09 16:03:10 +0000 |
---|---|---|
committer | ajuma@chromium.org <ajuma@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-09 16:03:10 +0000 |
commit | a9c13a25b263eca1e441d51281fd80ceb8c3f97b (patch) | |
tree | 9caa0f5da8bb46962b2694601c87180e766c9ef5 /cc | |
parent | 19bce3159a4278a722450c1603b350dc21641503 (diff) | |
download | chromium_src-a9c13a25b263eca1e441d51281fd80ceb8c3f97b.zip chromium_src-a9c13a25b263eca1e441d51281fd80ceb8c3f97b.tar.gz chromium_src-a9c13a25b263eca1e441d51281fd80ceb8c3f97b.tar.bz2 |
cc: Fix slow LayerTreeHostAnimationTest
This fixes LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers
whose single-thread versions were taking 4 seconds, since they couldn't
finish until there were no longer any running animations (in
single-thread mode, having running animations means continually having
pending commits).
This removes the running animations, allowing the test to finish.
BUG=None
Review URL: https://codereview.chromium.org/378943004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 64dd31d..f717c2a 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -1253,20 +1253,23 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl, bool has_unfinished_animation) OVERRIDE { - Animation* root_animation = host_impl->active_tree() - ->root_layer() - ->layer_animation_controller() - ->GetAnimation(Animation::Opacity); + LayerAnimationController* root_controller_impl = + host_impl->active_tree()->root_layer()->layer_animation_controller(); + Animation* root_animation = + root_controller_impl->GetAnimation(Animation::Opacity); if (!root_animation || root_animation->run_state() != Animation::Running) return; - Animation* child_animation = host_impl->active_tree() - ->root_layer() - ->children()[0] - ->layer_animation_controller() - ->GetAnimation(Animation::Opacity); + LayerAnimationController* child_controller_impl = + host_impl->active_tree()->root_layer()->children() + [0]->layer_animation_controller(); + Animation* child_animation = + child_controller_impl->GetAnimation(Animation::Opacity); EXPECT_EQ(Animation::Running, child_animation->run_state()); EXPECT_EQ(root_animation->start_time(), child_animation->start_time()); + root_controller_impl->AbortAnimations(Animation::Opacity); + root_controller_impl->AbortAnimations(Animation::Transform); + child_controller_impl->AbortAnimations(Animation::Opacity); EndTest(); } |