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 "ash/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
6 #include "ash/display/multi_display_manager.h" | 6 #include "ash/display/multi_display_manager.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 aura::Window* GetModalContainer(aura::RootWindow* root_window) { | 55 aura::Window* GetModalContainer(aura::RootWindow* root_window) { |
56 return Shell::GetContainer( | 56 return Shell::GetContainer( |
57 root_window, | 57 root_window, |
58 ash::internal::kShellWindowId_SystemModalContainer); | 58 ash::internal::kShellWindowId_SystemModalContainer); |
59 } | 59 } |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 | 62 |
63 namespace test { | 63 namespace test { |
| 64 class RootWindowControllerTest : public test::AshTestBase { |
| 65 public: |
| 66 RootWindowControllerTest() {} |
| 67 virtual ~RootWindowControllerTest() {} |
64 | 68 |
65 typedef test::AshTestBase RootWindowControllerTest; | 69 virtual void SetUp() OVERRIDE { |
| 70 internal::DisplayController::SetExtendedDesktopEnabled(true); |
| 71 AshTestBase::SetUp(); |
| 72 } |
| 73 |
| 74 virtual void TearDown() OVERRIDE { |
| 75 AshTestBase::TearDown(); |
| 76 internal::DisplayController::SetExtendedDesktopEnabled(false); |
| 77 } |
| 78 |
| 79 private: |
| 80 DISALLOW_COPY_AND_ASSIGN(RootWindowControllerTest); |
| 81 }; |
66 | 82 |
67 TEST_F(RootWindowControllerTest, MoveWindows_Basic) { | 83 TEST_F(RootWindowControllerTest, MoveWindows_Basic) { |
68 UpdateDisplay("600x600,500x500"); | 84 UpdateDisplay("600x600,500x500"); |
69 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 85 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
70 | 86 |
71 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); | 87 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); |
72 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); | 88 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); |
73 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); | 89 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); |
74 EXPECT_EQ("50,10 100x100", | 90 EXPECT_EQ("50,10 100x100", |
75 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); | 91 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 180 |
165 UpdateDisplay("500x500"); | 181 UpdateDisplay("500x500"); |
166 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); | 182 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); |
167 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 183 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
168 generator_1st.ClickLeftButton(); | 184 generator_1st.ClickLeftButton(); |
169 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 185 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
170 } | 186 } |
171 | 187 |
172 } // namespace test | 188 } // namespace test |
173 } // namespace ash | 189 } // namespace ash |
OLD | NEW |