OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 // Fails the test and returns ROTATE_0 if there is no second display. | 51 // Fails the test and returns ROTATE_0 if there is no second display. |
52 gfx::Display::Rotation GetRotationOfSecondDisplay() { | 52 gfx::Display::Rotation GetRotationOfSecondDisplay() { |
53 const ash::DisplayManager* const display_manager = GetDisplayManager(); | 53 const ash::DisplayManager* const display_manager = GetDisplayManager(); |
54 if (display_manager->GetNumDisplays() < 2) { | 54 if (display_manager->GetNumDisplays() < 2) { |
55 ADD_FAILURE() | 55 ADD_FAILURE() |
56 << "Requested rotation of second display while there was only one."; | 56 << "Requested rotation of second display while there was only one."; |
57 return gfx::Display::ROTATE_0; | 57 return gfx::Display::ROTATE_0; |
58 } | 58 } |
59 const ash::DisplayIdPair display_id_pair = | 59 const ash::DisplayIdList display_id_pair = |
60 display_manager->GetCurrentDisplayIdPair(); | 60 display_manager->GetCurrentDisplayIdList(); |
61 const gfx::Display& second_display = | 61 const gfx::Display& second_display = |
62 display_manager->GetDisplayForId(display_id_pair.second); | 62 display_manager->GetDisplayForId(display_id_pair[1]); |
63 return second_display.rotation(); | 63 return second_display.rotation(); |
64 } | 64 } |
65 | 65 |
66 } // anonymous namespace | 66 } // anonymous namespace |
67 | 67 |
68 namespace policy { | 68 namespace policy { |
69 | 69 |
70 class DisplayRotationDefaultTest | 70 class DisplayRotationDefaultTest |
71 : public policy::DevicePolicyCrosBrowserTest, | 71 : public policy::DevicePolicyCrosBrowserTest, |
72 public testing::WithParamInterface<gfx::Display::Rotation> { | 72 public testing::WithParamInterface<gfx::Display::Rotation> { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 321 } |
322 | 322 |
323 INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault, | 323 INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault, |
324 DisplayRotationBootTest, | 324 DisplayRotationBootTest, |
325 testing::Values(gfx::Display::ROTATE_0, | 325 testing::Values(gfx::Display::ROTATE_0, |
326 gfx::Display::ROTATE_90, | 326 gfx::Display::ROTATE_90, |
327 gfx::Display::ROTATE_180, | 327 gfx::Display::ROTATE_180, |
328 gfx::Display::ROTATE_270)); | 328 gfx::Display::ROTATE_270)); |
329 | 329 |
330 } // namespace policy | 330 } // namespace policy |
OLD | NEW |