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

Unified Diff: cc/animation/layer_animation_controller_unittest.cc

Issue 1587073011: Plumb NotifyAnimationAborted from the compositor to blink animation delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/animation/layer_animation_controller.cc ('k') | cc/blink/web_compositor_animation_player_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/layer_animation_controller_unittest.cc
diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc
index f47b0cf8ebd3f2862ad1caf6d0084db09a703021..5d23e99960891f0c63474771bcc23fe511f26ba8 100644
--- a/cc/animation/layer_animation_controller_unittest.cc
+++ b/cc/animation/layer_animation_controller_unittest.cc
@@ -1045,15 +1045,24 @@ class FakeAnimationDelegate : public AnimationDelegate {
finished_ = true;
}
+ void NotifyAnimationAborted(TimeTicks monotonic_time,
+ Animation::TargetProperty target_property,
+ int group) override {
+ aborted_ = true;
+ }
+
bool started() { return started_; }
bool finished() { return finished_; }
+ bool aborted() { return aborted_; }
+
TimeTicks start_time() { return start_time_; }
private:
bool started_;
bool finished_;
+ bool aborted_;
TimeTicks start_time_;
};
@@ -1868,6 +1877,8 @@ TEST(LayerAnimationControllerTest, ImplThreadAbortedAnimationGetsDeleted) {
scoped_refptr<LayerAnimationController> controller(
LayerAnimationController::Create(0));
controller->AddValueObserver(&dummy);
+ FakeAnimationDelegate delegate;
+ controller->set_layer_animation_delegate(&delegate);
int animation_id =
AddOpacityTransitionToController(controller.get(), 1.0, 0.f, 1.f, false);
@@ -1894,6 +1905,7 @@ TEST(LayerAnimationControllerTest, ImplThreadAbortedAnimationGetsDeleted) {
controller->NotifyAnimationAborted(events[0]);
EXPECT_EQ(Animation::ABORTED,
controller->GetAnimation(Animation::OPACITY)->run_state());
+ EXPECT_TRUE(delegate.aborted());
controller->Animate(kInitialTickTime + TimeDelta::FromMilliseconds(500));
controller->UpdateState(true, nullptr);
« no previous file with comments | « cc/animation/layer_animation_controller.cc ('k') | cc/blink/web_compositor_animation_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698