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

Unified Diff: ash/display/display_controller_unittest.cc

Issue 10870036: Allow storing display preferences per device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 055ca4b3e2bb2cb87411ab32c0b195cfce301f03..e870867bbdb405d87f3bf7b10987c63276ba37d5 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -26,6 +26,14 @@ gfx::Display GetSecondaryDisplay() {
Shell::GetAllRootWindows()[1]);
}
+void SetSecondaryDisplayLayout(internal::DisplayLayout::Position position) {
+ internal::DisplayController* display_controller =
+ Shell::GetInstance()->display_controller();
+ internal::DisplayLayout layout = display_controller->default_display_layout();
+ layout.position = position;
+ display_controller->SetDefaultDisplayLayout(layout);
+}
+
} // namespace
typedef test::AshTestBase DisplayControllerTest;
@@ -51,22 +59,19 @@ TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) {
EXPECT_EQ("505,5 390x390", GetSecondaryDisplay().work_area().ToString());
// Layout the secondary display to the bottom of the primary.
- Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout(
- internal::DisplayController::BOTTOM);
+ SetSecondaryDisplayLayout(internal::DisplayLayout::BOTTOM);
EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString());
EXPECT_EQ("0,500 400x400", GetSecondaryDisplay().bounds().ToString());
EXPECT_EQ("5,505 390x390", GetSecondaryDisplay().work_area().ToString());
// Layout the secondary display to the left of the primary.
- Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout(
- internal::DisplayController::LEFT);
+ SetSecondaryDisplayLayout(internal::DisplayLayout::LEFT);
EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString());
EXPECT_EQ("-400,0 400x400", GetSecondaryDisplay().bounds().ToString());
EXPECT_EQ("-395,5 390x390", GetSecondaryDisplay().work_area().ToString());
// Layout the secondary display to the top of the primary.
- Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout(
- internal::DisplayController::TOP);
+ SetSecondaryDisplayLayout(internal::DisplayLayout::TOP);
EXPECT_EQ("0,0 500x500", GetPrimaryDisplay().bounds().ToString());
EXPECT_EQ("0,-400 400x400", GetSecondaryDisplay().bounds().ToString());
EXPECT_EQ("5,-395 390x390", GetSecondaryDisplay().work_area().ToString());
@@ -77,8 +82,7 @@ TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) {
// always been incorrect, but is now visibly broken now that we're processing
// X11 configuration events while waiting for the MapNotify.
TEST_F(DisplayControllerTest, DISABLED_BoundsUpdated) {
- Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout(
- internal::DisplayController::BOTTOM);
+ SetSecondaryDisplayLayout(internal::DisplayLayout::BOTTOM);
UpdateDisplay("500x500,400x400");
gfx::Display* secondary_display =
aura::Env::GetInstance()->display_manager()->GetDisplayAt(1);
@@ -116,8 +120,8 @@ TEST_F(DisplayControllerTest, WarpMouse) {
ash::internal::DisplayController* controller =
Shell::GetInstance()->display_controller();
- EXPECT_EQ(internal::DisplayController::RIGHT,
- controller->secondary_display_layout());
+ EXPECT_EQ(internal::DisplayLayout::RIGHT,
+ controller->default_display_layout().position);
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
bool is_warped = controller->WarpMouseCursorIfNecessary(root_windows[0],
@@ -174,8 +178,8 @@ TEST_F(DisplayControllerTest, WarpMouseDifferentSizeDisplays) {
ash::internal::DisplayController* controller =
Shell::GetInstance()->display_controller();
- EXPECT_EQ(internal::DisplayController::RIGHT,
- controller->secondary_display_layout());
+ EXPECT_EQ(internal::DisplayLayout::RIGHT,
+ controller->default_display_layout().position);
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
aura::Env::GetInstance()->SetLastMouseLocation(*root_windows[1],

Powered by Google App Engine
This is Rietveld 408576698