summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 17:36:08 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 17:36:08 +0000
commit4b820efd4e9cdf68507e48d40f030e5536744abd (patch)
tree1b6e1cf4718b028742f5d63258af4f68a3ef2460 /cc
parent01b8d6508836ebc7d3cc12dbdfc218f7d626e946 (diff)
downloadchromium_src-4b820efd4e9cdf68507e48d40f030e5536744abd.zip
chromium_src-4b820efd4e9cdf68507e48d40f030e5536744abd.tar.gz
chromium_src-4b820efd4e9cdf68507e48d40f030e5536744abd.tar.bz2
Add missing nullity check to LayerTreeHostAnimationTestAnimationFinishedEvents
In LTHATAFE::notifyAnimationFinished we're incorrectly assuming a non-null animation. (Could be null if we receive the finished notification after we clean up the anim on the main thread). Similarly in the animation stated test, we assume that we'll get the second animation update on the main thread before we get the animation started notification, but this is racy. We need to be ready for either order. BUG=148490 Review URL: https://chromiumcodereview.appspot.com/12210131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/layer_tree_host_unittest_animation.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/cc/layer_tree_host_unittest_animation.cc b/cc/layer_tree_host_unittest_animation.cc
index 17db6fa..8a8d92f 100644
--- a/cc/layer_tree_host_unittest_animation.cc
+++ b/cc/layer_tree_host_unittest_animation.cc
@@ -133,14 +133,20 @@ class LayerTreeHostAnimationTestAddAnimation :
num_animates_++;
return;
}
- EXPECT_LT(0, start_time_);
- EXPECT_TRUE(received_animation_started_notification_);
- endTest();
+
+ if (received_animation_started_notification_) {
+ EXPECT_LT(0, start_time_);
+ endTest();
+ }
}
virtual void notifyAnimationStarted(double wall_clock_time) OVERRIDE {
received_animation_started_notification_ = true;
start_time_ = wall_clock_time;
+ if (num_animates_) {
+ EXPECT_LT(0, start_time_);
+ endTest();
+ }
}
virtual void afterTest() OVERRIDE {}
@@ -349,7 +355,8 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents :
m_layerTreeHost->rootLayer()->layerAnimationController();
Animation* animation =
controller->getAnimation(0, Animation::Opacity);
- controller->removeAnimation(animation->id());
+ if (animation)
+ controller->removeAnimation(animation->id());
endTest();
}