| Index: ui/views/animation/ink_drop_impl_unittest.cc
|
| diff --git a/ui/views/animation/ink_drop_impl_unittest.cc b/ui/views/animation/ink_drop_impl_unittest.cc
|
| index 2c5c0312e8e208e3a646812c1f868baef12abe07..cf5801af3a2e7eba9a4d9625d1dcbfc9a71b0e4c 100644
|
| --- a/ui/views/animation/ink_drop_impl_unittest.cc
|
| +++ b/ui/views/animation/ink_drop_impl_unittest.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/test/test_simple_task_runner.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "ui/compositor/scoped_animation_duration_scale_mode.h"
|
| #include "ui/views/animation/test/ink_drop_impl_test_api.h"
|
| #include "ui/views/animation/test/test_ink_drop_host.h"
|
|
|
| @@ -37,7 +38,7 @@ class InkDropImplTest : public testing::Test {
|
| // Returns true if the ink drop layers have been added to |ink_drop_host_|.
|
| bool AreLayersAddedToHost() const;
|
|
|
| - // Destroyes the |ink_drop_| and assocated |test_api_|.
|
| + // Destroys the |ink_drop_| and associated |test_api_|.
|
| void DestroyInkDrop();
|
|
|
| // Used to control the tasks scheduled by the InkDropImpl's Timer.
|
| @@ -254,6 +255,23 @@ TEST_F(InkDropImplTest,
|
| test_api()->state_factory());
|
| }
|
|
|
| +// Tests that if during destruction, a rippl animation is successfully ended, no
|
| +// crash happens (see https://crbug.com/663579).
|
| +TEST_F(InkDropImplTest, SuccessfulAnimationEndedDuringDestruction) {
|
| + // Start a ripple animation with non-zero duration.
|
| + ink_drop()->AnimateToState(InkDropState::ACTION_PENDING);
|
| + {
|
| + // Start another ripple animation with zero duration that would be queued
|
| + // until the previous one is finished/aborted.
|
| + ui::ScopedAnimationDurationScaleMode duration_mode(
|
| + ui::ScopedAnimationDurationScaleMode::ZERO_DURATION);
|
| + ink_drop()->AnimateToState(InkDropState::ACTION_TRIGGERED);
|
| + }
|
| + // Abort the first animation, so that the queued animation is started (and
|
| + // finished immediately since it has zero duration). No crash should happen.
|
| + DestroyInkDrop();
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| //
|
| // Common AutoHighlightMode tests
|
|
|