Chromium Code Reviews| 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/display/display_controller.h" | 7 #include "ash/display/display_controller.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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 363 EXPECT_EQ(Shell::GetContainer(controller->root_window(), | 363 EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 364 internal::kShellWindowId_SystemModalContainer)->layout_manager(), | 364 internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 365 controller->GetSystemModalLayoutManager(NULL)); | 365 controller->GetSystemModalLayoutManager(NULL)); |
| 366 | 366 |
| 367 views::Widget* session_modal_widget = | 367 views::Widget* session_modal_widget = |
| 368 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); | 368 CreateModalWidget(gfx::Rect(300, 10, 100, 100)); |
| 369 EXPECT_EQ(Shell::GetContainer(controller->root_window(), | 369 EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 370 internal::kShellWindowId_SystemModalContainer)->layout_manager(), | 370 internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 371 controller->GetSystemModalLayoutManager( | 371 controller->GetSystemModalLayoutManager( |
| 372 session_modal_widget->GetNativeView())); | 372 session_modal_widget->GetNativeView())); |
| 373 } | 373 } |
|
James Cook
2013/04/22 18:14:16
Can you add a test for the GetFullscreenWindow() f
| |
| 374 | 374 |
| 375 // Ensure a workspace with two windows reports immersive mode even if only | |
| 376 // one has the property set. | |
| 377 TEST_F(RootWindowControllerTest, ImmersiveMode) { | |
| 378 UpdateDisplay("600x600"); | |
| 379 internal::RootWindowController* controller = | |
| 380 Shell::GetInstance()->GetPrimaryRootWindowController(); | |
| 381 | |
| 382 // Open a maximized window. | |
| 383 Widget* w1 = CreateTestWidget(gfx::Rect(0, 1, 250, 251)); | |
| 384 w1->Maximize(); | |
| 385 | |
| 386 // Immersive mode off by default. | |
| 387 EXPECT_FALSE(controller->IsImmersiveMode()); | |
| 388 | |
| 389 // Enter immersive mode. | |
| 390 w1->GetNativeWindow()->SetProperty(ash::internal::kImmersiveModeKey, true); | |
| 391 EXPECT_TRUE(controller->IsImmersiveMode()); | |
| 392 | |
| 393 // Add a child, like a print window. Still in immersive mode. | |
| 394 Widget* w2 = | |
| 395 Widget::CreateWindowWithParentAndBounds(NULL, | |
| 396 w1->GetNativeWindow(), | |
| 397 gfx::Rect(0, 1, 150, 151)); | |
| 398 w2->Show(); | |
| 399 EXPECT_TRUE(controller->IsImmersiveMode()); | |
| 400 } | |
| 401 | |
| 402 } // namespace test | 375 } // namespace test |
| 403 } // namespace ash | 376 } // namespace ash |
| OLD | NEW |