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

Unified Diff: ash/system/tray/system_tray_unittest.cc

Issue 289743002: Overview Button Tray Animation accounting for startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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
« no previous file with comments | « ash/system/status_area_widget_delegate.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/system/status_area_widget_delegate.cc ('k') | ash/system/tray/tray_background_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698