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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // Switch to unified. | 328 // Switch to unified. |
329 UpdateDisplay("500x500,500x500"); | 329 UpdateDisplay("500x500,500x500"); |
330 | 330 |
331 // In unified mode, RWC is created | 331 // In unified mode, RWC is created |
332 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); | 332 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); |
333 | 333 |
334 ASSERT_EQ(lock_screen->GetNativeWindow(), | 334 ASSERT_EQ(lock_screen->GetNativeWindow(), |
335 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); | 335 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); |
336 ASSERT_EQ(lock_background->GetNativeWindow(), | 336 ASSERT_EQ(lock_background->GetNativeWindow(), |
337 controller->GetRootWindow()->GetChildById(kLockBackgroundWindowId)); | 337 controller->GetRootWindow()->GetChildById(kLockBackgroundWindowId)); |
338 EXPECT_EQ("0,0 1000x500", | 338 EXPECT_EQ("0,0 500x500", lock_screen->GetNativeWindow()->bounds().ToString()); |
339 lock_screen->GetNativeWindow()->bounds().ToString()); | |
340 | 339 |
341 // Switch to mirror. | 340 // Switch to mirror. |
342 display_manager->SetMirrorMode(true); | 341 display_manager->SetMirrorMode(true); |
343 EXPECT_TRUE(display_manager->IsInMirrorMode()); | 342 EXPECT_TRUE(display_manager->IsInMirrorMode()); |
344 | 343 |
345 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); | 344 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); |
346 ASSERT_EQ(lock_screen->GetNativeWindow(), | 345 ASSERT_EQ(lock_screen->GetNativeWindow(), |
347 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); | 346 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); |
348 ASSERT_EQ(lock_background->GetNativeWindow(), | 347 ASSERT_EQ(lock_background->GetNativeWindow(), |
349 controller->GetRootWindow()->GetChildById(kLockBackgroundWindowId)); | 348 controller->GetRootWindow()->GetChildById(kLockBackgroundWindowId)); |
350 EXPECT_EQ("0,0 500x500", lock_screen->GetNativeWindow()->bounds().ToString()); | 349 EXPECT_EQ("0,0 500x500", lock_screen->GetNativeWindow()->bounds().ToString()); |
351 | 350 |
352 // Switch to unified. | 351 // Switch to unified. |
353 display_manager->SetMirrorMode(false); | 352 display_manager->SetMirrorMode(false); |
354 EXPECT_TRUE(display_manager->IsInUnifiedMode()); | 353 EXPECT_TRUE(display_manager->IsInUnifiedMode()); |
355 | 354 |
356 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); | 355 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); |
357 | 356 |
358 ASSERT_EQ(lock_screen->GetNativeWindow(), | 357 ASSERT_EQ(lock_screen->GetNativeWindow(), |
359 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); | 358 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); |
360 ASSERT_EQ(lock_background->GetNativeWindow(), | 359 ASSERT_EQ(lock_background->GetNativeWindow(), |
361 controller->GetRootWindow()->GetChildById(kLockBackgroundWindowId)); | 360 controller->GetRootWindow()->GetChildById(kLockBackgroundWindowId)); |
362 EXPECT_EQ("0,0 1000x500", | 361 EXPECT_EQ("0,0 500x500", lock_screen->GetNativeWindow()->bounds().ToString()); |
363 lock_screen->GetNativeWindow()->bounds().ToString()); | |
364 | 362 |
365 // Switch to single display. | 363 // Switch to single display. |
366 UpdateDisplay("600x500"); | 364 UpdateDisplay("600x500"); |
367 EXPECT_FALSE(display_manager->IsInUnifiedMode()); | 365 EXPECT_FALSE(display_manager->IsInUnifiedMode()); |
368 EXPECT_FALSE(display_manager->IsInMirrorMode()); | 366 EXPECT_FALSE(display_manager->IsInMirrorMode()); |
369 | 367 |
370 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); | 368 controller = Shell::GetInstance()->GetPrimaryRootWindowController(); |
371 | 369 |
372 ASSERT_EQ(lock_screen->GetNativeWindow(), | 370 ASSERT_EQ(lock_screen->GetNativeWindow(), |
373 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); | 371 controller->GetRootWindow()->GetChildById(kLockScreenWindowId)); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 keyboard_controller->proxy()->GetKeyboardWindow()->SetBounds( | 1042 keyboard_controller->proxy()->GetKeyboardWindow()->SetBounds( |
1045 gfx::Rect(0, 400, 800, 200)); | 1043 gfx::Rect(0, 400, 800, 200)); |
1046 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); | 1044 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); |
1047 | 1045 |
1048 UpdateDisplay("600x800"); | 1046 UpdateDisplay("600x800"); |
1049 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); | 1047 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); |
1050 } | 1048 } |
1051 | 1049 |
1052 } // namespace test | 1050 } // namespace test |
1053 } // namespace ash | 1051 } // namespace ash |
OLD | NEW |