| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/content/shell_content_state.h" | 8 #include "ash/content/shell_content_state.h" |
| 9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 SetDisplayRotationById(gfx::Display::kInvalidDisplayID, | 609 SetDisplayRotationById(gfx::Display::kInvalidDisplayID, |
| 610 gfx::Display::ROTATE_180); | 610 gfx::Display::ROTATE_180); |
| 611 EXPECT_FALSE(RotationLocked()); | 611 EXPECT_FALSE(RotationLocked()); |
| 612 | 612 |
| 613 // With an internal display now available, functionality should resume. | 613 // With an internal display now available, functionality should resume. |
| 614 gfx::Display::SetInternalDisplayId(internal_display_id); | 614 gfx::Display::SetInternalDisplayId(internal_display_id); |
| 615 SetInternalDisplayRotation(gfx::Display::ROTATE_90); | 615 SetInternalDisplayRotation(gfx::Display::ROTATE_90); |
| 616 EXPECT_TRUE(RotationLocked()); | 616 EXPECT_TRUE(RotationLocked()); |
| 617 } | 617 } |
| 618 | 618 |
| 619 // Verifies rotating an inactive Display is sucessful. | 619 // Verifies rotating an inactive Display is successful. |
| 620 TEST_F(ScreenOrientationControllerTest, RotateInactiveDisplay) { | 620 TEST_F(ScreenOrientationControllerTest, RotateInactiveDisplay) { |
| 621 const int64 kInternalDisplayId = 9; | 621 const int64 kInternalDisplayId = 9; |
| 622 const int64 kExternalDisplayId = 10; | 622 const int64 kExternalDisplayId = 10; |
| 623 const gfx::Display::Rotation kNewRotation = gfx::Display::ROTATE_180; | 623 const gfx::Display::Rotation kNewRotation = gfx::Display::ROTATE_180; |
| 624 | 624 |
| 625 const DisplayInfo internal_display_info = | 625 const DisplayInfo internal_display_info = |
| 626 CreateDisplayInfo(kInternalDisplayId, gfx::Rect(0, 0, 500, 500)); | 626 CreateDisplayInfo(kInternalDisplayId, gfx::Rect(0, 0, 500, 500)); |
| 627 const DisplayInfo external_display_info = | 627 const DisplayInfo external_display_info = |
| 628 CreateDisplayInfo(kExternalDisplayId, gfx::Rect(1, 1, 500, 500)); | 628 CreateDisplayInfo(kExternalDisplayId, gfx::Rect(1, 1, 500, 500)); |
| 629 | 629 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 647 .GetActiveRotation()); | 647 .GetActiveRotation()); |
| 648 | 648 |
| 649 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( | 649 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( |
| 650 kNewRotation, gfx::Display::ROTATION_SOURCE_ACTIVE); | 650 kNewRotation, gfx::Display::ROTATION_SOURCE_ACTIVE); |
| 651 | 651 |
| 652 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId) | 652 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId) |
| 653 .GetActiveRotation()); | 653 .GetActiveRotation()); |
| 654 } | 654 } |
| 655 | 655 |
| 656 } // namespace ash | 656 } // namespace ash |
| OLD | NEW |