| 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..c798e78c09823134e2e0b8b8026a794e474ba2ac 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,26 @@ 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());
|
| +
|
| + scoped_ptr<ui::ScopedAnimationDurationScaleMode> animation_duration;
|
| + animation_duration.reset(
|
| + new ui::ScopedAnimationDurationScaleMode(
|
| + ui::ScopedAnimationDurationScaleMode::SLOW_DURATION));
|
| + tray->SetVisible(false);
|
| + EXPECT_TRUE(tray->visible());
|
| + EXPECT_EQ(0.0f, tray->layer()->GetTargetOpacity());
|
| +
|
| + tray->SetVisible(true);
|
| + animation_duration.reset();
|
| + tray->layer()->GetAnimator()->StopAnimating();
|
| + EXPECT_TRUE(tray->visible());
|
| + EXPECT_EQ(1.0f, tray->layer()->GetTargetOpacity());
|
| +}
|
| +
|
| } // namespace test
|
| } // namespace ash
|
|
|