| 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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/accessibility_delegate.h" | 10 #include "ash/accessibility_delegate.h" |
| 11 #include "ash/frame/custom_frame_view_ash.h" | 11 #include "ash/frame/custom_frame_view_ash.h" |
| 12 #include "ash/public/cpp/config.h" | 12 #include "ash/public/cpp/config.h" |
| 13 #include "ash/public/cpp/shell_window_ids.h" | 13 #include "ash/public/cpp/shell_window_ids.h" |
| 14 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
| 15 #include "ash/screen_util.h" | 15 #include "ash/screen_util.h" |
| 16 #include "ash/session/session_controller.h" | 16 #include "ash/session/session_controller.h" |
| 17 #include "ash/shared/app_types.h" | 17 #include "ash/shared/app_types.h" |
| 18 #include "ash/shelf/shelf.h" |
| 18 #include "ash/shelf/shelf_constants.h" | 19 #include "ash/shelf/shelf_constants.h" |
| 19 #include "ash/shelf/shelf_layout_manager.h" | 20 #include "ash/shelf/shelf_layout_manager.h" |
| 20 #include "ash/shelf/wm_shelf.h" | |
| 21 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 22 #include "ash/shell_observer.h" | 22 #include "ash/shell_observer.h" |
| 23 #include "ash/shell_port.h" | 23 #include "ash/shell_port.h" |
| 24 #include "ash/system/tray/system_tray_notifier.h" | 24 #include "ash/system/tray/system_tray_notifier.h" |
| 25 #include "ash/test/ash_test_base.h" | 25 #include "ash/test/ash_test_base.h" |
| 26 #include "ash/test/shell_test_api.h" | 26 #include "ash/test/shell_test_api.h" |
| 27 #include "ash/test/test_accessibility_delegate.h" | 27 #include "ash/test/test_accessibility_delegate.h" |
| 28 #include "ash/test/test_session_controller_client.h" | 28 #include "ash/test/test_session_controller_client.h" |
| 29 #include "ash/test/workspace_controller_test_api.h" | 29 #include "ash/test/workspace_controller_test_api.h" |
| 30 #include "ash/wm/fullscreen_window_finder.h" | 30 #include "ash/wm/fullscreen_window_finder.h" |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 | 929 |
| 930 // Verify if the window is not resized during screen lock. See: crbug.com/173127 | 930 // Verify if the window is not resized during screen lock. See: crbug.com/173127 |
| 931 TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) { | 931 TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) { |
| 932 SetCanLockScreen(true); | 932 SetCanLockScreen(true); |
| 933 std::unique_ptr<aura::Window> window( | 933 std::unique_ptr<aura::Window> window( |
| 934 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4))); | 934 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4))); |
| 935 // window with AlwaysOnTop will be managed by BaseLayoutManager. | 935 // window with AlwaysOnTop will be managed by BaseLayoutManager. |
| 936 window->SetProperty(aura::client::kAlwaysOnTopKey, true); | 936 window->SetProperty(aura::client::kAlwaysOnTopKey, true); |
| 937 window->Show(); | 937 window->Show(); |
| 938 | 938 |
| 939 WmShelf* shelf = GetPrimaryShelf(); | 939 Shelf* shelf = GetPrimaryShelf(); |
| 940 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 940 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 941 | 941 |
| 942 window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get())); | 942 window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get())); |
| 943 gfx::Rect window_bounds = window->bounds(); | 943 gfx::Rect window_bounds = window->bounds(); |
| 944 EXPECT_EQ( | 944 EXPECT_EQ( |
| 945 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), | 945 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), |
| 946 window_bounds.ToString()); | 946 window_bounds.ToString()); |
| 947 | 947 |
| 948 // The window size should not get touched while we are in lock screen. | 948 // The window size should not get touched while we are in lock screen. |
| 949 Shell::Get()->session_controller()->LockScreenAndFlushForTest(); | 949 Shell::Get()->session_controller()->LockScreenAndFlushForTest(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 EXPECT_EQ("b,x", GetWindowOrderAsString(backdrop, window1.get(), | 1116 EXPECT_EQ("b,x", GetWindowOrderAsString(backdrop, window1.get(), |
| 1117 window2.get(), window3.get())); | 1117 window2.get(), window3.get())); |
| 1118 ShowTopWindowBackdrop(false); | 1118 ShowTopWindowBackdrop(false); |
| 1119 EXPECT_EQ("b", GetWindowOrderAsString(nullptr, window1.get(), window2.get(), | 1119 EXPECT_EQ("b", GetWindowOrderAsString(nullptr, window1.get(), window2.get(), |
| 1120 window3.get())); | 1120 window3.get())); |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 // Tests that when hidding the shelf, that the backdrop stays fullscreen. | 1123 // Tests that when hidding the shelf, that the backdrop stays fullscreen. |
| 1124 TEST_F(WorkspaceLayoutManagerBackdropTest, | 1124 TEST_F(WorkspaceLayoutManagerBackdropTest, |
| 1125 ShelfVisibilityDoesNotChangesBounds) { | 1125 ShelfVisibilityDoesNotChangesBounds) { |
| 1126 WmShelf* shelf = GetPrimaryShelf(); | 1126 Shelf* shelf = GetPrimaryShelf(); |
| 1127 ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); | 1127 ShelfLayoutManager* shelf_layout_manager = shelf->shelf_layout_manager(); |
| 1128 ShowTopWindowBackdrop(true); | 1128 ShowTopWindowBackdrop(true); |
| 1129 RunAllPendingInMessageLoop(); | 1129 RunAllPendingInMessageLoop(); |
| 1130 const gfx::Size fullscreen_size = | 1130 const gfx::Size fullscreen_size = |
| 1131 display::Screen::GetScreen()->GetPrimaryDisplay().size(); | 1131 display::Screen::GetScreen()->GetPrimaryDisplay().size(); |
| 1132 | 1132 |
| 1133 std::unique_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); | 1133 std::unique_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); |
| 1134 window->Show(); | 1134 window->Show(); |
| 1135 | 1135 |
| 1136 ASSERT_EQ(SHELF_VISIBLE, shelf_layout_manager->visibility_state()); | 1136 ASSERT_EQ(SHELF_VISIBLE, shelf_layout_manager->visibility_state()); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 window->SetBounds(keyboard_bounds()); | 1538 window->SetBounds(keyboard_bounds()); |
| 1539 wm::GetWindowState(window.get())->set_ignore_keyboard_bounds_change(true); | 1539 wm::GetWindowState(window.get())->set_ignore_keyboard_bounds_change(true); |
| 1540 wm::ActivateWindow(window.get()); | 1540 wm::ActivateWindow(window.get()); |
| 1541 | 1541 |
| 1542 EXPECT_EQ(keyboard_bounds(), window->bounds()); | 1542 EXPECT_EQ(keyboard_bounds(), window->bounds()); |
| 1543 ShowKeyboard(); | 1543 ShowKeyboard(); |
| 1544 EXPECT_EQ(keyboard_bounds(), window->bounds()); | 1544 EXPECT_EQ(keyboard_bounds(), window->bounds()); |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 } // namespace ash | 1547 } // namespace ash |
| OLD | NEW |