| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/corewm/visibility_controller.h" | 5 #include "ui/views/corewm/visibility_controller.h" |
| 6 | 6 |
| 7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
| 8 #include "ui/aura/test/aura_test_base.h" | 8 #include "ui/aura/test/aura_test_base.h" |
| 9 #include "ui/aura/test/test_window_delegate.h" | 9 #include "ui/aura/test/test_window_delegate.h" |
| 10 #include "ui/aura/test/test_windows.h" | 10 #include "ui/aura/test/test_windows.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // We cannot disable animations for this test. | 24 // We cannot disable animations for this test. |
| 25 ui::ScopedAnimationDurationScaleMode normal_duration_mode( | 25 ui::ScopedAnimationDurationScaleMode normal_duration_mode( |
| 26 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); | 26 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); |
| 27 | 27 |
| 28 VisibilityController controller; | 28 VisibilityController controller; |
| 29 aura::client::SetVisibilityClient(root_window(), &controller); | 29 aura::client::SetVisibilityClient(root_window(), &controller); |
| 30 | 30 |
| 31 SetChildWindowVisibilityChangesAnimated(root_window()); | 31 SetChildWindowVisibilityChangesAnimated(root_window()); |
| 32 | 32 |
| 33 aura::test::TestWindowDelegate d; | 33 aura::test::TestWindowDelegate d; |
| 34 scoped_ptr<aura::Window> animatable( | 34 scoped_ptr<aura::Window> animatable(aura::test::CreateTestWindowWithDelegate( |
| 35 aura::test::CreateTestWindowWithDelegate( | 35 &d, -2, gfx::Rect(0, 0, 50, 50), root_window())); |
| 36 &d, -2, gfx::Rect(0, 0, 50, 50), root_window())); | |
| 37 scoped_ptr<aura::Window> non_animatable( | 36 scoped_ptr<aura::Window> non_animatable( |
| 38 aura::test::CreateTestWindowWithDelegateAndType( | 37 aura::test::CreateTestWindowWithDelegateAndType( |
| 39 &d, aura::client::WINDOW_TYPE_CONTROL, -3, gfx::Rect(51, 51, 50, 50), | 38 &d, |
| 39 ui::wm::WINDOW_TYPE_CONTROL, |
| 40 -3, |
| 41 gfx::Rect(51, 51, 50, 50), |
| 40 root_window())); | 42 root_window())); |
| 41 EXPECT_TRUE(animatable->IsVisible()); | 43 EXPECT_TRUE(animatable->IsVisible()); |
| 42 EXPECT_TRUE(animatable->layer()->visible()); | 44 EXPECT_TRUE(animatable->layer()->visible()); |
| 43 animatable->Hide(); | 45 animatable->Hide(); |
| 44 EXPECT_FALSE(animatable->IsVisible()); | 46 EXPECT_FALSE(animatable->IsVisible()); |
| 45 EXPECT_TRUE(animatable->layer()->visible()); | 47 EXPECT_TRUE(animatable->layer()->visible()); |
| 46 | 48 |
| 47 EXPECT_TRUE(non_animatable->IsVisible()); | 49 EXPECT_TRUE(non_animatable->IsVisible()); |
| 48 EXPECT_TRUE(non_animatable->layer()->visible()); | 50 EXPECT_TRUE(non_animatable->layer()->visible()); |
| 49 non_animatable->Hide(); | 51 non_animatable->Hide(); |
| 50 EXPECT_FALSE(non_animatable->IsVisible()); | 52 EXPECT_FALSE(non_animatable->IsVisible()); |
| 51 EXPECT_FALSE(non_animatable->layer()->visible()); | 53 EXPECT_FALSE(non_animatable->layer()->visible()); |
| 52 | 54 |
| 53 aura::client::SetVisibilityClient(root_window(), NULL); | 55 aura::client::SetVisibilityClient(root_window(), NULL); |
| 54 } | 56 } |
| 55 | 57 |
| 56 } // namespace corewm | 58 } // namespace corewm |
| 57 } // namespace views | 59 } // namespace views |
| OLD | NEW |