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

Unified Diff: ui/views/animation/ink_drop_impl_unittest.cc

Issue 2499453002: Add ink drop ripple to overview mode button (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 | « ui/views/animation/ink_drop_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/views/animation/ink_drop_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698