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

Unified Diff: ui/aura/window_unittest.cc

Issue 23654037: Add panels as a single group of windows per display for overview window cycling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/aura/window.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 320d1a61f7b052bc61c95eaa2ebe159bf019f1af..fa4c66a65e0da4b740722524e0e87fccab5fd80b 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -1531,6 +1531,33 @@ TEST_F(WindowTest, Visibility) {
EXPECT_EQ(1, d2.shown());
}
+// Verifies that IsVisible will immediately return the state set by the last
+// call to SetVisible even if the window is animating visiblility.
+TEST_F(WindowTest, IsVisibleRespectsSetVisible) {
+ // We cannot short-circuit animations in this test.
+ ui::ScopedAnimationDurationScaleMode normal_duration_mode(
+ ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
+
+ scoped_ptr<Window> w1(
+ CreateTestWindowWithBounds(gfx::Rect(0, 0, 100, 100), root_window()));
+ EXPECT_FALSE(!w1->layer());
sky 2013/09/13 21:46:44 ASSERT (otherwise you're going to crash on 1547).
flackr 2013/09/13 22:28:38 Done.
+
+ // Start an animation to hide the window.
+ {
+ ui::ScopedLayerAnimationSettings settings(w1->layer()->GetAnimator());
+ w1->layer()->SetVisible(false);
+ }
+
+ // Window is still visible, but is animating to be hidden.
+ EXPECT_TRUE(w1->IsVisible());
+ EXPECT_FALSE(w1->layer()->GetTargetVisibility());
+
+ // Now, explicitly hide the window and verify that IsVisible corresponds to
+ // the hidden state.
+ w1->Hide();
+ EXPECT_FALSE(w1->IsVisible());
+}
+
TEST_F(WindowTest, IgnoreEventsTest) {
TestWindowDelegate d11;
TestWindowDelegate d12;
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698