| 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/screen_orientation_controller_chromeos.h" | 5 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // generated. | 131 // generated. |
| 132 std::unique_ptr<views::WebViewTestHelper> webview_test_helper_; | 132 std::unique_ptr<views::WebViewTestHelper> webview_test_helper_; |
| 133 | 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationControllerTest); | 134 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationControllerTest); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 ScreenOrientationControllerTest::ScreenOrientationControllerTest() { | 137 ScreenOrientationControllerTest::ScreenOrientationControllerTest() { |
| 138 webview_test_helper_.reset(new views::WebViewTestHelper()); | 138 webview_test_helper_.reset(new views::WebViewTestHelper()); |
| 139 } | 139 } |
| 140 | 140 |
| 141 ScreenOrientationControllerTest::~ScreenOrientationControllerTest() { | 141 ScreenOrientationControllerTest::~ScreenOrientationControllerTest() {} |
| 142 } | |
| 143 | 142 |
| 144 content::WebContents* ScreenOrientationControllerTest::CreateWebContents() { | 143 content::WebContents* ScreenOrientationControllerTest::CreateWebContents() { |
| 145 return views::ViewsDelegate::GetInstance()->CreateWebContents( | 144 return views::ViewsDelegate::GetInstance()->CreateWebContents( |
| 146 ShellContentState::GetInstance()->GetActiveBrowserContext(), nullptr); | 145 ShellContentState::GetInstance()->GetActiveBrowserContext(), nullptr); |
| 147 } | 146 } |
| 148 | 147 |
| 149 content::WebContents* | 148 content::WebContents* |
| 150 ScreenOrientationControllerTest::CreateSecondaryWebContents() { | 149 ScreenOrientationControllerTest::CreateSecondaryWebContents() { |
| 151 secondary_browser_context_.reset(new content::TestBrowserContext()); | 150 secondary_browser_context_.reset(new content::TestBrowserContext()); |
| 152 return views::ViewsDelegate::GetInstance()->CreateWebContents( | 151 return views::ViewsDelegate::GetInstance()->CreateWebContents( |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 | 637 |
| 639 // The DisplayInfo list with two active displays needs to be added first so | 638 // The DisplayInfo list with two active displays needs to be added first so |
| 640 // that the DisplayManager can track the |internal_display_info| as inactive | 639 // that the DisplayManager can track the |internal_display_info| as inactive |
| 641 // instead of non-existent. | 640 // instead of non-existent. |
| 642 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 641 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
| 643 display_manager->UpdateDisplaysWith(display_info_list_two_active); | 642 display_manager->UpdateDisplaysWith(display_info_list_two_active); |
| 644 display_manager->UpdateDisplaysWith(display_info_list_one_active); | 643 display_manager->UpdateDisplaysWith(display_info_list_one_active); |
| 645 | 644 |
| 646 test::ScopedSetInternalDisplayId set_internal(kInternalDisplayId); | 645 test::ScopedSetInternalDisplayId set_internal(kInternalDisplayId); |
| 647 | 646 |
| 648 ASSERT_NE(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId) | 647 ASSERT_NE( |
| 649 .GetActiveRotation()); | 648 kNewRotation, |
| 649 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); |
| 650 | 650 |
| 651 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( | 651 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( |
| 652 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); | 652 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); |
| 653 | 653 |
| 654 EXPECT_EQ(kNewRotation, display_manager->GetDisplayInfo(kInternalDisplayId) | 654 EXPECT_EQ( |
| 655 .GetActiveRotation()); | 655 kNewRotation, |
| 656 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); |
| 656 } | 657 } |
| 657 | 658 |
| 658 } // namespace ash | 659 } // namespace ash |
| OLD | NEW |