| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_util.h" | 5 #include "ash/display/display_util.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 | 12 |
| 13 typedef test::AshTestBase DisplayUtilTest; | 13 typedef test::AshTestBase DisplayUtilTest; |
| 14 | 14 |
| 15 TEST_F(DisplayUtilTest, RotatedDisplay) { | 15 TEST_F(DisplayUtilTest, RotatedDisplay) { |
| 16 if (!SupportsMultipleDisplays()) | |
| 17 return; | |
| 18 { | 16 { |
| 19 UpdateDisplay("10+10-500x400,600+10-1000x600/r"); | 17 UpdateDisplay("10+10-500x400,600+10-1000x600/r"); |
| 20 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 18 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 21 AshWindowTreeHost* host0 = | 19 AshWindowTreeHost* host0 = |
| 22 GetRootWindowController(root_windows[0])->ash_host(); | 20 GetRootWindowController(root_windows[0])->ash_host(); |
| 23 AshWindowTreeHost* host1 = | 21 AshWindowTreeHost* host1 = |
| 24 GetRootWindowController(root_windows[1])->ash_host(); | 22 GetRootWindowController(root_windows[1])->ash_host(); |
| 25 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300)); | 23 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300)); |
| 26 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300)); | 24 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300)); |
| 27 EXPECT_EQ("509,20 1x300", rect0.ToString()); | 25 EXPECT_EQ("509,20 1x300", rect0.ToString()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 AshWindowTreeHost* host1 = | 82 AshWindowTreeHost* host1 = |
| 85 GetRootWindowController(root_windows[1])->ash_host(); | 83 GetRootWindowController(root_windows[1])->ash_host(); |
| 86 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300)); | 84 gfx::Rect rect0 = GetNativeEdgeBounds(host0, gfx::Rect(499, 10, 1, 300)); |
| 87 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300)); | 85 gfx::Rect rect1 = GetNativeEdgeBounds(host1, gfx::Rect(500, 10, 1, 300)); |
| 88 EXPECT_EQ("10,99 1x300", rect0.ToString()); | 86 EXPECT_EQ("10,99 1x300", rect0.ToString()); |
| 89 EXPECT_EQ("600,20 1x300", rect1.ToString()); | 87 EXPECT_EQ("600,20 1x300", rect1.ToString()); |
| 90 } | 88 } |
| 91 } | 89 } |
| 92 | 90 |
| 93 } // namespace ash | 91 } // namespace ash |
| OLD | NEW |