OLD | NEW |
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_controller.h" | 5 #include "ash/display/display_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 Shell::GetAllRootWindows()[0]); | 22 Shell::GetAllRootWindows()[0]); |
23 } | 23 } |
24 | 24 |
25 gfx::Display GetSecondaryDisplay() { | 25 gfx::Display GetSecondaryDisplay() { |
26 return gfx::Screen::GetDisplayNearestWindow( | 26 return gfx::Screen::GetDisplayNearestWindow( |
27 Shell::GetAllRootWindows()[1]); | 27 Shell::GetAllRootWindows()[1]); |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 typedef test::AshTestBase DisplayControllerTest; | 32 class DisplayControllerTest : public test::AshTestBase { |
| 33 public: |
| 34 DisplayControllerTest() {} |
| 35 virtual ~DisplayControllerTest() {} |
| 36 |
| 37 virtual void SetUp() OVERRIDE { |
| 38 internal::DisplayController::SetExtendedDesktopEnabled(true); |
| 39 AshTestBase::SetUp(); |
| 40 } |
| 41 |
| 42 virtual void TearDown() OVERRIDE { |
| 43 AshTestBase::TearDown(); |
| 44 internal::DisplayController::SetExtendedDesktopEnabled(false); |
| 45 } |
| 46 |
| 47 private: |
| 48 DISALLOW_COPY_AND_ASSIGN(DisplayControllerTest); |
| 49 }; |
33 | 50 |
34 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
35 // TOD(oshima): Windows creates a window with smaller client area. | 52 // TOD(oshima): Windows creates a window with smaller client area. |
36 // Fix this and enable tests. | 53 // Fix this and enable tests. |
37 #define MAYBE_SecondaryDisplayLayout DISABLED_SecondaryDisplayLayout | 54 #define MAYBE_SecondaryDisplayLayout DISABLED_SecondaryDisplayLayout |
38 #define MAYBE_BoundsUpdated DISABLED_BoundsUpdated | 55 #define MAYBE_BoundsUpdated DISABLED_BoundsUpdated |
39 #else | 56 #else |
40 #define MAYBE_SecondaryDisplayLayout SecondaryDisplayLayout | 57 #define MAYBE_SecondaryDisplayLayout SecondaryDisplayLayout |
41 #define MAYBE_BoundsUpdated BoundsUpdated | 58 #define MAYBE_BoundsUpdated BoundsUpdated |
42 #endif | 59 #endif |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 EXPECT_EQ(1, gfx::Screen::GetNumDisplays()); | 120 EXPECT_EQ(1, gfx::Screen::GetNumDisplays()); |
104 | 121 |
105 UpdateDisplay("700x700,1000x1000"); | 122 UpdateDisplay("700x700,1000x1000"); |
106 ASSERT_EQ(2, gfx::Screen::GetNumDisplays()); | 123 ASSERT_EQ(2, gfx::Screen::GetNumDisplays()); |
107 EXPECT_EQ("0,0 700x700", GetPrimaryDisplay().bounds().ToString()); | 124 EXPECT_EQ("0,0 700x700", GetPrimaryDisplay().bounds().ToString()); |
108 EXPECT_EQ("0,700 1000x1000", GetSecondaryDisplay().bounds().ToString()); | 125 EXPECT_EQ("0,700 1000x1000", GetSecondaryDisplay().bounds().ToString()); |
109 } | 126 } |
110 | 127 |
111 } // namespace test | 128 } // namespace test |
112 } // namespace ash | 129 } // namespace ash |
OLD | NEW |