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

Side by Side Diff: ash/display/display_manager_unittest.cc

Issue 18413002: [Cleanup] Factor out layout store code from DisplayController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_layout_store.h"
8 #include "ash/screen_ash.h" 9 #include "ash/screen_ash.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
11 #include "ash/test/display_manager_test_api.h" 12 #include "ash/test/display_manager_test_api.h"
12 #include "ash/test/mirror_window_test_api.h" 13 #include "ash/test/mirror_window_test_api.h"
13 #include "base/format_macros.h" 14 #include "base/format_macros.h"
14 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
16 #include "ui/aura/env.h" 17 #include "ui/aura/env.h"
17 #include "ui/aura/root_window.h" 18 #include "ui/aura/root_window.h"
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 // The mouse pointer is outside and closest display is 1st one. 641 // The mouse pointer is outside and closest display is 1st one.
641 UpdateDisplay("300x280,200x200"); 642 UpdateDisplay("300x280,200x200");
642 EXPECT_EQ("150,140", env->last_mouse_location().ToString()); 643 EXPECT_EQ("150,140", env->last_mouse_location().ToString());
643 } 644 }
644 645
645 TEST_F(DisplayManagerTest, EnsurePointerInDisplays_2ndOnLeft) { 646 TEST_F(DisplayManagerTest, EnsurePointerInDisplays_2ndOnLeft) {
646 if (!SupportsMultipleDisplays()) 647 if (!SupportsMultipleDisplays())
647 return; 648 return;
648 649
649 // Set the 2nd display on the left. 650 // Set the 2nd display on the left.
650 DisplayController* display_controller = 651 DisplayLayoutStore* layout_store =
651 Shell::GetInstance()->display_controller(); 652 Shell::GetInstance()->display_manager()->layout_store();
652 DisplayLayout layout = display_controller->default_display_layout(); 653 DisplayLayout layout = layout_store->default_display_layout();
653 layout.position = DisplayLayout::LEFT; 654 layout.position = DisplayLayout::LEFT;
654 display_controller->SetDefaultDisplayLayout(layout); 655 layout_store->SetDefaultDisplayLayout(layout);
655 656
656 UpdateDisplay("200x200,300x300"); 657 UpdateDisplay("200x200,300x300");
657 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 658 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
658 659
659 EXPECT_EQ("-300,0 300x300", 660 EXPECT_EQ("-300,0 300x300",
660 ScreenAsh::GetSecondaryDisplay().bounds().ToString()); 661 ScreenAsh::GetSecondaryDisplay().bounds().ToString());
661 662
662 aura::Env* env = aura::Env::GetInstance(); 663 aura::Env* env = aura::Env::GetInstance();
663 664
664 // Set the initial position. 665 // Set the initial position.
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 UpdateDisplay("400x600/o,600x800/o"); 975 UpdateDisplay("400x600/o,600x800/o");
975 EXPECT_FALSE(display_observer.changed_and_reset()); 976 EXPECT_FALSE(display_observer.changed_and_reset());
976 EXPECT_EQ("400x600", test_api.GetRootWindow()->bounds().size().ToString()); 977 EXPECT_EQ("400x600", test_api.GetRootWindow()->bounds().size().ToString());
977 EXPECT_EQ("600x800", GetMirroredDisplay().size().ToString()); 978 EXPECT_EQ("600x800", GetMirroredDisplay().size().ToString());
978 979
979 Shell::GetScreen()->RemoveObserver(&display_observer); 980 Shell::GetScreen()->RemoveObserver(&display_observer);
980 } 981 }
981 982
982 } // namespace internal 983 } // namespace internal
983 } // namespace ash 984 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698