| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef ASH_TEST_ASH_TEST_HELPER_H_ | 5 #ifndef ASH_TEST_ASH_TEST_HELPER_H_ |
| 6 #define ASH_TEST_ASH_TEST_HELPER_H_ | 6 #define ASH_TEST_ASH_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <utility> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 14 #include "ash/common/test/test_session_controller_client.h" |
| 13 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" | 16 #include "base/macros.h" |
| 15 #include "ui/aura/test/mus/test_window_tree_client_setup.h" | 17 #include "ui/aura/test/mus/test_window_tree_client_setup.h" |
| 16 | 18 |
| 17 namespace aura { | 19 namespace aura { |
| 18 class Window; | 20 class Window; |
| 19 class WindowTreeClientPrivate; | 21 class WindowTreeClientPrivate; |
| 20 } // namespace aura | 22 } // namespace aura |
| 21 | 23 |
| 22 namespace display { | 24 namespace display { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 namespace mus { | 40 namespace mus { |
| 39 class WindowManagerApplication; | 41 class WindowManagerApplication; |
| 40 } | 42 } |
| 41 | 43 |
| 42 namespace test { | 44 namespace test { |
| 43 | 45 |
| 44 class AshTestEnvironment; | 46 class AshTestEnvironment; |
| 45 class AshTestViewsDelegate; | 47 class AshTestViewsDelegate; |
| 46 class TestScreenshotDelegate; | 48 class TestScreenshotDelegate; |
| 47 class TestShellDelegate; | 49 class TestShellDelegate; |
| 50 class TestSessionControllerClient; |
| 48 class TestSessionStateDelegate; | 51 class TestSessionStateDelegate; |
| 49 | 52 |
| 50 // A helper class that does common initialization required for Ash. Creates a | 53 // A helper class that does common initialization required for Ash. Creates a |
| 51 // root window and an ash::Shell instance with a test delegate. | 54 // root window and an ash::Shell instance with a test delegate. |
| 52 class AshTestHelper { | 55 class AshTestHelper { |
| 53 public: | 56 public: |
| 54 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); | 57 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); |
| 55 ~AshTestHelper(); | 58 ~AshTestHelper(); |
| 56 | 59 |
| 57 // Creates the ash::Shell and performs associated initialization. Set | 60 // Creates the ash::Shell and performs associated initialization. Set |
| (...skipping 26 matching lines...) Expand all Loading... |
| 84 // Version of DisplayManagerTestApi::UpdateDisplay() for mash. | 87 // Version of DisplayManagerTestApi::UpdateDisplay() for mash. |
| 85 void UpdateDisplayForMash(const std::string& display_spec); | 88 void UpdateDisplayForMash(const std::string& display_spec); |
| 86 | 89 |
| 87 display::Display GetSecondaryDisplay(); | 90 display::Display GetSecondaryDisplay(); |
| 88 | 91 |
| 89 // Null in classic ash. | 92 // Null in classic ash. |
| 90 mus::WindowManagerApplication* window_manager_app() { | 93 mus::WindowManagerApplication* window_manager_app() { |
| 91 return window_manager_app_.get(); | 94 return window_manager_app_.get(); |
| 92 } | 95 } |
| 93 | 96 |
| 97 TestSessionControllerClient* test_session_controller_client() { |
| 98 return session_controller_client_.get(); |
| 99 } |
| 100 void set_test_session_controller_client( |
| 101 std::unique_ptr<TestSessionControllerClient> session_controller_client) { |
| 102 session_controller_client_ = std::move(session_controller_client); |
| 103 } |
| 104 |
| 94 private: | 105 private: |
| 95 // Called when running in mash to create the WindowManager. | 106 // Called when running in mash to create the WindowManager. |
| 96 void CreateMashWindowManager(); | 107 void CreateMashWindowManager(); |
| 97 | 108 |
| 98 // Called when running in ash to create Shell. | 109 // Called when running in ash to create Shell. |
| 99 void CreateShell(); | 110 void CreateShell(); |
| 100 | 111 |
| 101 // Creates a new RootWindowController based on |display_spec|. The origin is | 112 // Creates a new RootWindowController based on |display_spec|. The origin is |
| 102 // set to |next_x| and on exit |next_x| is set to the origin + the width. | 113 // set to |next_x| and on exit |next_x| is set to the origin + the width. |
| 103 RootWindowController* CreateRootWindowController( | 114 RootWindowController* CreateRootWindowController( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 125 bool dbus_thread_manager_initialized_; | 136 bool dbus_thread_manager_initialized_; |
| 126 // Check if Bluez DBus Manager was initialized here. | 137 // Check if Bluez DBus Manager was initialized here. |
| 127 bool bluez_dbus_manager_initialized_; | 138 bool bluez_dbus_manager_initialized_; |
| 128 | 139 |
| 129 aura::TestWindowTreeClientSetup window_tree_client_setup_; | 140 aura::TestWindowTreeClientSetup window_tree_client_setup_; |
| 130 std::unique_ptr<mus::WindowManagerApplication> window_manager_app_; | 141 std::unique_ptr<mus::WindowManagerApplication> window_manager_app_; |
| 131 std::unique_ptr<aura::WindowTreeClientPrivate> window_tree_client_private_; | 142 std::unique_ptr<aura::WindowTreeClientPrivate> window_tree_client_private_; |
| 132 // Id for the next Display created by CreateRootWindowController(). | 143 // Id for the next Display created by CreateRootWindowController(). |
| 133 int64_t next_display_id_ = 1; | 144 int64_t next_display_id_ = 1; |
| 134 | 145 |
| 146 std::unique_ptr<TestSessionControllerClient> session_controller_client_; |
| 147 |
| 135 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); | 148 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); |
| 136 }; | 149 }; |
| 137 | 150 |
| 138 } // namespace test | 151 } // namespace test |
| 139 } // namespace ash | 152 } // namespace ash |
| 140 | 153 |
| 141 #endif // ASH_TEST_ASH_TEST_HELPER_H_ | 154 #endif // ASH_TEST_ASH_TEST_HELPER_H_ |
| OLD | NEW |