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() {} | |
68 | 64 |
69 virtual void SetUp() OVERRIDE { | 65 typedef test::AshTestBase RootWindowControllerTest; |
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 }; | |
82 | 66 |
83 TEST_F(RootWindowControllerTest, MoveWindows_Basic) { | 67 TEST_F(RootWindowControllerTest, MoveWindows_Basic) { |
84 UpdateDisplay("600x600,500x500"); | 68 UpdateDisplay("600x600,500x500"); |
85 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 69 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
86 | 70 |
87 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); | 71 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); |
88 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); | 72 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); |
89 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); | 73 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); |
90 EXPECT_EQ("50,10 100x100", | 74 EXPECT_EQ("50,10 100x100", |
91 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); | 75 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 164 |
181 UpdateDisplay("500x500"); | 165 UpdateDisplay("500x500"); |
182 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); | 166 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); |
183 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 167 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
184 generator_1st.ClickLeftButton(); | 168 generator_1st.ClickLeftButton(); |
185 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); | 169 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
186 } | 170 } |
187 | 171 |
188 } // namespace test | 172 } // namespace test |
189 } // namespace ash | 173 } // namespace ash |
OLD | NEW |