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/common/wm/workspace/workspace_event_handler.h" | 5 #include "ash/common/wm/workspace/workspace_event_handler.h" |
6 | 6 |
7 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
8 #include "ash/common/wm/wm_event.h" | 8 #include "ash/common/wm/wm_event.h" |
9 #include "ash/common/wm/workspace_controller.h" | 9 #include "ash/common/wm/workspace_controller.h" |
| 10 #include "ash/display/display_manager.h" |
10 #include "ash/screen_util.h" | 11 #include "ash/screen_util.h" |
11 #include "ash/shell.h" | 12 #include "ash/shell.h" |
12 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
13 #include "ash/wm/window_state_aura.h" | 14 #include "ash/wm/window_state_aura.h" |
14 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
15 #include "ash/wm/workspace_controller_test_helper.h" | 16 #include "ash/wm/workspace_controller_test_helper.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
17 #include "ui/aura/client/aura_constants.h" | 18 #include "ui/aura/client/aura_constants.h" |
18 #include "ui/aura/test/test_window_delegate.h" | 19 #include "ui/aura/test/test_window_delegate.h" |
19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 EXPECT_EQ(restored_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 160 EXPECT_EQ(restored_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
160 | 161 |
161 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
162 // Multi display test does not run on Win8 bot. crbug.com/247427. | 163 // Multi display test does not run on Win8 bot. crbug.com/247427. |
163 if (!SupportsMultipleDisplays()) | 164 if (!SupportsMultipleDisplays()) |
164 return; | 165 return; |
165 #endif | 166 #endif |
166 | 167 |
167 // Verify the double clicking the resize edge works on 2nd display too. | 168 // Verify the double clicking the resize edge works on 2nd display too. |
168 UpdateDisplay("200x200,400x300"); | 169 UpdateDisplay("200x200,400x300"); |
169 gfx::Rect work_area2 = ScreenUtil::GetSecondaryDisplay().work_area(); | 170 gfx::Rect work_area2 = display_manager()->GetSecondaryDisplay().work_area(); |
170 restored_bounds.SetRect(220, 20, 50, 50); | 171 restored_bounds.SetRect(220, 20, 50, 50); |
171 window->SetBoundsInScreen(restored_bounds, ScreenUtil::GetSecondaryDisplay()); | 172 window->SetBoundsInScreen(restored_bounds, |
| 173 display_manager()->GetSecondaryDisplay()); |
172 aura::Window* second_root = Shell::GetAllRootWindows()[1]; | 174 aura::Window* second_root = Shell::GetAllRootWindows()[1]; |
173 EXPECT_EQ(second_root, window->GetRootWindow()); | 175 EXPECT_EQ(second_root, window->GetRootWindow()); |
174 ui::test::EventGenerator generator2(second_root, window.get()); | 176 ui::test::EventGenerator generator2(second_root, window.get()); |
175 | 177 |
176 // Y-axis maximization. | 178 // Y-axis maximization. |
177 delegate.set_window_component(HTTOP); | 179 delegate.set_window_component(HTTOP); |
178 generator2.PressLeftButton(); | 180 generator2.PressLeftButton(); |
179 generator2.ReleaseLeftButton(); | 181 generator2.ReleaseLeftButton(); |
180 generator2.set_flags(ui::EF_IS_DOUBLE_CLICK); | 182 generator2.set_flags(ui::EF_IS_DOUBLE_CLICK); |
181 generator2.PressLeftButton(); | 183 generator2.PressLeftButton(); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 delegate.set_window_component(HTCAPTION); | 531 delegate.set_window_component(HTCAPTION); |
530 generator.PressRightButton(); | 532 generator.PressRightButton(); |
531 generator.ReleaseRightButton(); | 533 generator.ReleaseRightButton(); |
532 EXPECT_FALSE(window_state->IsMaximized()); | 534 EXPECT_FALSE(window_state->IsMaximized()); |
533 ClickButtonWithFlags(&generator, ui::EF_LEFT_MOUSE_BUTTON, | 535 ClickButtonWithFlags(&generator, ui::EF_LEFT_MOUSE_BUTTON, |
534 ui::EF_IS_DOUBLE_CLICK); | 536 ui::EF_IS_DOUBLE_CLICK); |
535 EXPECT_FALSE(window_state->IsMaximized()); | 537 EXPECT_FALSE(window_state->IsMaximized()); |
536 } | 538 } |
537 | 539 |
538 } // namespace ash | 540 } // namespace ash |
OLD | NEW |