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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include "ash/session/session_state_delegate.h" | 7 #include "ash/session/session_state_delegate.h" |
8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 views::Widget* session_modal_widget = | 369 views::Widget* session_modal_widget = |
370 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); | 370 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); |
371 EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer) | 371 EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer) |
372 ->layout_manager(), | 372 ->layout_manager(), |
373 controller->GetSystemModalLayoutManager( | 373 controller->GetSystemModalLayoutManager( |
374 session_modal_widget->GetNativeView())); | 374 session_modal_widget->GetNativeView())); |
375 } | 375 } |
376 | 376 |
377 TEST_F(RootWindowControllerTest, ModalContainerBlockedSession) { | 377 TEST_F(RootWindowControllerTest, ModalContainerBlockedSession) { |
378 UpdateDisplay("600x600"); | 378 UpdateDisplay("600x600"); |
379 Shell* shell = Shell::GetInstance(); | 379 RootWindowController* controller = Shell::GetPrimaryRootWindowController(); |
380 RootWindowController* controller = shell->GetPrimaryRootWindowController(); | |
381 aura::Window* lock_container = | 380 aura::Window* lock_container = |
382 controller->GetContainer(kShellWindowId_LockScreenContainer); | 381 controller->GetContainer(kShellWindowId_LockScreenContainer); |
383 for (int block_reason = FIRST_BLOCK_REASON; | 382 for (int block_reason = FIRST_BLOCK_REASON; |
384 block_reason < NUMBER_OF_BLOCK_REASONS; | 383 block_reason < NUMBER_OF_BLOCK_REASONS; |
385 ++block_reason) { | 384 ++block_reason) { |
386 views::Widget* session_modal_widget = | 385 views::Widget* session_modal_widget = |
387 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); | 386 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); |
388 EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer) | 387 EXPECT_EQ(controller->GetContainer(kShellWindowId_SystemModalContainer) |
389 ->layout_manager(), | 388 ->layout_manager(), |
390 controller->GetSystemModalLayoutManager( | 389 controller->GetSystemModalLayoutManager( |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 ASSERT_TRUE(keyboard_container); | 954 ASSERT_TRUE(keyboard_container); |
956 keyboard_container->Show(); | 955 keyboard_container->Show(); |
957 EXPECT_EQ("0,0 800x600", keyboard_container->bounds().ToString()); | 956 EXPECT_EQ("0,0 800x600", keyboard_container->bounds().ToString()); |
958 | 957 |
959 UpdateDisplay("600x800"); | 958 UpdateDisplay("600x800"); |
960 EXPECT_EQ("0,0 600x800", keyboard_container->bounds().ToString()); | 959 EXPECT_EQ("0,0 600x800", keyboard_container->bounds().ToString()); |
961 } | 960 } |
962 | 961 |
963 } // namespace test | 962 } // namespace test |
964 } // namespace ash | 963 } // namespace ash |
OLD | NEW |