| 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_layout_manager.h" | 5 #include "ash/common/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/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 } | 834 } |
| 835 | 835 |
| 836 // Verify if the window is not resized during screen lock. See: crbug.com/173127 | 836 // Verify if the window is not resized during screen lock. See: crbug.com/173127 |
| 837 TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) { | 837 TEST_F(WorkspaceLayoutManagerSoloTest, NotResizeWhenScreenIsLocked) { |
| 838 SetCanLockScreen(true); | 838 SetCanLockScreen(true); |
| 839 std::unique_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); | 839 std::unique_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); |
| 840 // window with AlwaysOnTop will be managed by BaseLayoutManager. | 840 // window with AlwaysOnTop will be managed by BaseLayoutManager. |
| 841 window->SetProperty(aura::client::kAlwaysOnTopKey, true); | 841 window->SetProperty(aura::client::kAlwaysOnTopKey, true); |
| 842 window->Show(); | 842 window->Show(); |
| 843 | 843 |
| 844 Shelf* shelf = Shelf::ForWindow(window.get()); | 844 Shelf* shelf = Shelf::ForWindow(WmWindowAura::Get(window.get())); |
| 845 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 845 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 846 | 846 |
| 847 window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get())); | 847 window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get())); |
| 848 gfx::Rect window_bounds = window->bounds(); | 848 gfx::Rect window_bounds = window->bounds(); |
| 849 EXPECT_EQ( | 849 EXPECT_EQ( |
| 850 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), | 850 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), |
| 851 window_bounds.ToString()); | 851 window_bounds.ToString()); |
| 852 | 852 |
| 853 // The window size should not get touched while we are in lock screen. | 853 // The window size should not get touched while we are in lock screen. |
| 854 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); | 854 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 changed_window_bounds.Offset(0, -shift); | 1309 changed_window_bounds.Offset(0, -shift); |
| 1310 // Window should be shifted up. | 1310 // Window should be shifted up. |
| 1311 EXPECT_EQ(changed_window_bounds, window->bounds()); | 1311 EXPECT_EQ(changed_window_bounds, window->bounds()); |
| 1312 | 1312 |
| 1313 kb_controller->HideKeyboard( | 1313 kb_controller->HideKeyboard( |
| 1314 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); | 1314 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); |
| 1315 EXPECT_EQ(orig_window_bounds, window->bounds()); | 1315 EXPECT_EQ(orig_window_bounds, window->bounds()); |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 } // namespace ash | 1318 } // namespace ash |
| OLD | NEW |