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

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: rebase Created 8 years, 3 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
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/display/mouse_cursor_event_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 7f2d46195b174471a4cec1344b3dd4171f0793bf..99157530db64b06a33fe2e3801d583d2c83d98dd 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(DisplayLayout::Position position) {
+ DisplayController* display_controller =
+ Shell::GetInstance()->display_controller();
+ 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(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(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(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(DisplayLayout::BOTTOM);
UpdateDisplay("500x500,400x400");
gfx::Display* secondary_display =
aura::Env::GetInstance()->display_manager()->GetDisplayAt(1);
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/display/mouse_cursor_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698