Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: ash/root_window_controller_unittest.cc

Issue 1116313002: Layout login/lock screen, shelf and app list inside the first display in Unified Desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/screen_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/screen_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698