Index: ash/system/tray/system_tray_unittest.cc |
diff --git a/ash/system/tray/system_tray_unittest.cc b/ash/system/tray/system_tray_unittest.cc |
index fbf285925eea860832cd042ae55814d0954e3419..a29420316ad52c4fdda1668cb2ecf7ef4d2a43e3 100644 |
--- a/ash/system/tray/system_tray_unittest.cc |
+++ b/ash/system/tray/system_tray_unittest.cc |
@@ -21,6 +21,7 @@ |
#include "ui/aura/test/event_generator.h" |
#include "ui/aura/window.h" |
#include "ui/base/ui_base_types.h" |
+#include "ui/compositor/scoped_animation_duration_scale_mode.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/views/controls/label.h" |
#include "ui/views/layout/fill_layout.h" |
@@ -483,5 +484,22 @@ TEST_F(SystemTrayTest, MAYBE_WithSystemModal) { |
EXPECT_TRUE(settings->visible()); |
} |
+// Tests that if SetVisible(true) is called while animating to hidden that the |
+// tray becomes visible, and stops animating to hidden. |
+TEST_F(SystemTrayTest, SetVisibleDuringHideAnimation) { |
+ SystemTray* tray = GetSystemTray(); |
+ ASSERT_TRUE(tray->visible()); |
+ |
+ ui::ScopedAnimationDurationScaleMode long_duration( |
+ ui::ScopedAnimationDurationScaleMode::SLOW_DURATION); |
+ tray->SetVisible(false); |
+ EXPECT_TRUE(tray->visible()); |
+ EXPECT_EQ(0.0f, tray->layer()->GetTargetOpacity()); |
+ |
+ tray->SetVisible(true); |
+ EXPECT_TRUE(tray->visible()); |
flackr
2014/05/14 17:32:43
This test should end the animation before verifyin
jonross
2014/05/14 23:28:47
Updated to set clear the scoped duration, and set
|
+ EXPECT_EQ(1.0f, tray->layer()->GetTargetOpacity()); |
+} |
+ |
} // namespace test |
} // namespace ash |