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

Unified Diff: ui/gfx/animation/slide_animation_unittest.cc

Issue 2679333002: [ash-md] Remove the number of animators used for the Shelf animations. (Closed)
Patch Set: Created 3 years, 10 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
« ui/gfx/animation/slide_animation.cc ('K') | « ui/gfx/animation/slide_animation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/animation/slide_animation_unittest.cc
diff --git a/ui/gfx/animation/slide_animation_unittest.cc b/ui/gfx/animation/slide_animation_unittest.cc
index b22dab77ca9279481e3c72384f3833d9f3dcae00..121fa66b286dda80a41e3c430f2b7567af0d513e 100644
--- a/ui/gfx/animation/slide_animation_unittest.cc
+++ b/ui/gfx/animation/slide_animation_unittest.cc
@@ -41,7 +41,7 @@ class SlideAnimationTest: public testing::Test {
// Tests animation construction.
TEST_F(SlideAnimationTest, InitialState) {
- SlideAnimation animation(NULL);
+ SlideAnimation animation(nullptr);
// By default, slide animations are 60 Hz, so the timer interval should be
// 1/60th of a second.
EXPECT_EQ(1000 / 60, animation.timer_interval().InMilliseconds());
@@ -55,7 +55,7 @@ TEST_F(SlideAnimationTest, InitialState) {
}
TEST_F(SlideAnimationTest, Basics) {
- SlideAnimation animation(NULL);
+ SlideAnimation animation(nullptr);
SlideAnimation::TestApi test_api(&animation);
// Use linear tweening to make the math easier below.
@@ -87,6 +87,22 @@ TEST_F(SlideAnimationTest, Basics) {
EXPECT_FALSE(animation.IsClosing());
}
+TEST_F(SlideAnimationTest, ShowAndHideImmediately) {
+ SlideAnimation animation(nullptr);
+ SlideAnimation::TestApi test_api(&animation);
+
+ EXPECT_NE(1.0, animation.GetCurrentValue());
+
+ animation.ShowImmediately();
+ EXPECT_FALSE(animation.is_animating());
+ EXPECT_TRUE(animation.IsShowing());
+ EXPECT_EQ(1.0, animation.GetCurrentValue());
+
+ animation.HideImmediately();
+ EXPECT_FALSE(animation.is_animating());
+ EXPECT_EQ(0.0, animation.GetCurrentValue());
+}
+
// Tests that delegate is not notified when animation is running and is deleted.
// (Such a scenario would cause problems for BoundsAnimator).
TEST_F(SlideAnimationTest, DontNotifyOnDelete) {
« ui/gfx/animation/slide_animation.cc ('K') | « ui/gfx/animation/slide_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698