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" |
11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
13 #include "ash/content/shell_content_state.h" | 13 #include "ash/content/shell_content_state.h" |
14 #include "ash/display/display_manager.h" | 14 #include "ash/display/display_manager.h" |
15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
16 #include "ash/test/ash_test_base.h" | 16 #include "ash/test/ash_test_base.h" |
| 17 #include "ash/test/ash_test_environment_content.h" |
17 #include "ash/test/ash_test_helper.h" | 18 #include "ash/test/ash_test_helper.h" |
18 #include "ash/test/content/test_shell_content_state.h" | 19 #include "ash/test/content/test_shell_content_state.h" |
19 #include "ash/test/display_manager_test_api.h" | 20 #include "ash/test/display_manager_test_api.h" |
20 #include "ash/test/test_shell_delegate.h" | 21 #include "ash/test/test_shell_delegate.h" |
21 #include "ash/test/test_system_tray_delegate.h" | 22 #include "ash/test/test_system_tray_delegate.h" |
22 #include "base/command_line.h" | 23 #include "base/command_line.h" |
23 #include "chromeos/accelerometer/accelerometer_reader.h" | 24 #include "chromeos/accelerometer/accelerometer_reader.h" |
24 #include "chromeos/accelerometer/accelerometer_types.h" | 25 #include "chromeos/accelerometer/accelerometer_types.h" |
25 #include "content/public/browser/browser_context.h" | 26 #include "content/public/browser/browser_context.h" |
26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 102 } |
102 | 103 |
103 } // namespace | 104 } // namespace |
104 | 105 |
105 class ScreenOrientationControllerTest : public test::AshTestBase { | 106 class ScreenOrientationControllerTest : public test::AshTestBase { |
106 public: | 107 public: |
107 ScreenOrientationControllerTest(); | 108 ScreenOrientationControllerTest(); |
108 ~ScreenOrientationControllerTest() override; | 109 ~ScreenOrientationControllerTest() override; |
109 | 110 |
110 content::ScreenOrientationDelegate* delegate() { | 111 content::ScreenOrientationDelegate* delegate() { |
111 return ash_test_helper() | 112 test::AshTestEnvironmentContent* test_environment_content = |
112 ->test_shell_content_state() | 113 static_cast<test::AshTestEnvironmentContent*>( |
| 114 ash_test_helper()->ash_test_environment()); |
| 115 return test_environment_content->test_shell_content_state() |
113 ->screen_orientation_delegate(); | 116 ->screen_orientation_delegate(); |
114 } | 117 } |
115 | 118 |
116 // Creates and initializes and empty content::WebContents that is backed by a | 119 // Creates and initializes and empty content::WebContents that is backed by a |
117 // content::BrowserContext and that has an aura::Window. | 120 // content::BrowserContext and that has an aura::Window. |
118 content::WebContents* CreateWebContents(); | 121 content::WebContents* CreateWebContents(); |
119 | 122 |
120 // Creates a secondary content::WebContents, with a separate | 123 // Creates a secondary content::WebContents, with a separate |
121 // content::BrowserContext. | 124 // content::BrowserContext. |
122 content::WebContents* CreateSecondaryWebContents(); | 125 content::WebContents* CreateSecondaryWebContents(); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 | 654 |
652 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( | 655 Shell::GetInstance()->screen_orientation_controller()->SetDisplayRotation( |
653 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); | 656 kNewRotation, display::Display::ROTATION_SOURCE_ACTIVE); |
654 | 657 |
655 EXPECT_EQ( | 658 EXPECT_EQ( |
656 kNewRotation, | 659 kNewRotation, |
657 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); | 660 display_manager->GetDisplayInfo(kInternalDisplayId).GetActiveRotation()); |
658 } | 661 } |
659 | 662 |
660 } // namespace ash | 663 } // namespace ash |
OLD | NEW |