diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-03 08:33:43 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-03 08:33:43 +0000 |
commit | edbfb8de83d0ca45c2a42d6d3efd4cd3c1566e67 (patch) | |
tree | 1e815951ec91b93c404e561ab96376ab8ac986f8 /ash/extended_desktop_unittest.cc | |
parent | 0fd1e5e8005741b0309da3c7934c30a524b5dc0b (diff) | |
download | chromium_src-edbfb8de83d0ca45c2a42d6d3efd4cd3c1566e67.zip chromium_src-edbfb8de83d0ca45c2a42d6d3efd4cd3c1566e67.tar.gz chromium_src-edbfb8de83d0ca45c2a42d6d3efd4cd3c1566e67.tar.bz2 |
Allow storing display preferences per device.
BUG=137516
Review URL: https://chromiumcodereview.appspot.com/10870036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/extended_desktop_unittest.cc')
-rw-r--r-- | ash/extended_desktop_unittest.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index 572bb68..5b65afe 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -44,6 +44,14 @@ views::Widget* CreateTestWidget(const gfx::Rect& bounds) { return CreateTestWidgetWithParent(NULL, bounds, false); } +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); +} + class ModalWidgetDelegate : public views::WidgetDelegateView { public: ModalWidgetDelegate() {} @@ -242,8 +250,7 @@ TEST_F(ExtendedDesktopTest, CycleWindows) { TEST_F(ExtendedDesktopTest, GetRootWindowAt) { UpdateDisplay("700x500,500x500"); - Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( - internal::DisplayController::LEFT); + SetSecondaryDisplayLayout(DisplayLayout::LEFT); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(root_windows[1], wm::GetRootWindowAt(gfx::Point(-400, 100))); @@ -261,8 +268,7 @@ TEST_F(ExtendedDesktopTest, GetRootWindowAt) { TEST_F(ExtendedDesktopTest, GetRootWindowMatching) { UpdateDisplay("700x500,500x500"); - Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( - internal::DisplayController::LEFT); + SetSecondaryDisplayLayout(DisplayLayout::LEFT); Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); @@ -504,8 +510,7 @@ TEST_F(ExtendedDesktopTest, ConvertPoint) { EXPECT_EQ("-1010,-10", p.ToString()); // Move the 2nd display to the bottom and test again. - Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( - internal::DisplayController::BOTTOM); + SetSecondaryDisplayLayout(DisplayLayout::BOTTOM); display_2 = GetDisplayManager()->FindDisplayForRootWindow(root_windows[1]); EXPECT_EQ("0,600", display_2.bounds().origin().ToString()); |