| 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/base_layout_manager.h" | 5 #include "ash/wm/base_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
| 8 #include "ash/session_state_delegate.h" | 8 #include "ash/session_state_delegate.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 // Verify if the window is not resized during screen lock. See: crbug.com/173127 | 283 // Verify if the window is not resized during screen lock. See: crbug.com/173127 |
| 284 TEST_F(BaseLayoutManagerTest, NotResizeWhenScreenIsLocked) { | 284 TEST_F(BaseLayoutManagerTest, NotResizeWhenScreenIsLocked) { |
| 285 SetCanLockScreen(true); | 285 SetCanLockScreen(true); |
| 286 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); | 286 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(1, 2, 3, 4))); |
| 287 // window with AlwaysOnTop will be managed by BaseLayoutManager. | 287 // window with AlwaysOnTop will be managed by BaseLayoutManager. |
| 288 window->SetProperty(aura::client::kAlwaysOnTopKey, true); | 288 window->SetProperty(aura::client::kAlwaysOnTopKey, true); |
| 289 window->Show(); | 289 window->Show(); |
| 290 | 290 |
| 291 internal::ShelfLayoutManager* shelf = | 291 internal::ShelfLayoutManager* shelf = |
| 292 internal::ShelfLayoutManager::ForLauncher(window.get()); | 292 internal::ShelfLayoutManager::ForShelf(window.get()); |
| 293 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 293 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 294 | 294 |
| 295 window->SetBounds(ScreenAsh::GetMaximizedWindowBoundsInParent(window.get())); | 295 window->SetBounds(ScreenAsh::GetMaximizedWindowBoundsInParent(window.get())); |
| 296 gfx::Rect window_bounds = window->bounds(); | 296 gfx::Rect window_bounds = window->bounds(); |
| 297 EXPECT_EQ( | 297 EXPECT_EQ( |
| 298 ScreenAsh::GetMaximizedWindowBoundsInParent(window.get()).ToString(), | 298 ScreenAsh::GetMaximizedWindowBoundsInParent(window.get()).ToString(), |
| 299 window_bounds.ToString()); | 299 window_bounds.ToString()); |
| 300 | 300 |
| 301 Shell::GetInstance()->session_state_delegate()->LockScreen(); | 301 Shell::GetInstance()->session_state_delegate()->LockScreen(); |
| 302 shelf->UpdateVisibilityState(); | 302 shelf->UpdateVisibilityState(); |
| 303 EXPECT_NE( | 303 EXPECT_NE( |
| 304 ScreenAsh::GetMaximizedWindowBoundsInParent(window.get()).ToString(), | 304 ScreenAsh::GetMaximizedWindowBoundsInParent(window.get()).ToString(), |
| 305 window_bounds.ToString()); | 305 window_bounds.ToString()); |
| 306 | 306 |
| 307 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 307 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); |
| 308 shelf->UpdateVisibilityState(); | 308 shelf->UpdateVisibilityState(); |
| 309 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); | 309 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace | 312 } // namespace |
| 313 } // namespace ash | 313 } // namespace ash |
| OLD | NEW |