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 #ifndef SERVICES_UI_WS_WINDOW_SERVER_TEST_BASE_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_SERVER_TEST_BASE_H_ |
6 #define SERVICES_UI_WS_WINDOW_SERVER_TEST_BASE_H_ | 6 #define SERVICES_UI_WS_WINDOW_SERVER_TEST_BASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "services/service_manager/public/cpp/interface_factory.h" | 12 #include "services/service_manager/public/cpp/interface_factory.h" |
13 #include "services/ui/public/interfaces/window_tree.mojom.h" | 13 #include "services/ui/public/interfaces/window_tree.mojom.h" |
14 #include "services/ui/ws/window_server_service_test_base.h" | 14 #include "services/ui/ws/window_server_service_test_base.h" |
15 #include "ui/aura/mus/property_converter.h" | 15 #include "ui/aura/mus/property_converter.h" |
16 #include "ui/aura/mus/window_manager_delegate.h" | 16 #include "ui/aura/mus/window_manager_delegate.h" |
17 #include "ui/aura/mus/window_tree_client_delegate.h" | 17 #include "ui/aura/mus/window_tree_client_delegate.h" |
18 #include "ui/display/screen_base.h" | 18 #include "ui/display/screen_base.h" |
19 #include "ui/wm/core/wm_state.h" | 19 #include "ui/wm/core/wm_state.h" |
20 | 20 |
21 namespace aura { | 21 namespace aura { |
22 class Env; | 22 class Env; |
23 class MusContextFactory; | 23 class MusContextFactory; |
24 } | 24 } |
25 | 25 |
26 namespace ui { | 26 namespace ui { |
27 class GpuService; | 27 class Gpu; |
28 | 28 |
29 // WindowServerTestBase is a base class for use with shell tests that use | 29 // WindowServerTestBase is a base class for use with shell tests that use |
30 // WindowServer. SetUp() connects to the WindowServer and blocks until OnEmbed() | 30 // WindowServer. SetUp() connects to the WindowServer and blocks until OnEmbed() |
31 // has been invoked. window_manager() can be used to access the WindowServer | 31 // has been invoked. window_manager() can be used to access the WindowServer |
32 // established as part of SetUp(). | 32 // established as part of SetUp(). |
33 class WindowServerTestBase | 33 class WindowServerTestBase |
34 : public WindowServerServiceTestBase, | 34 : public WindowServerServiceTestBase, |
35 public aura::WindowTreeClientDelegate, | 35 public aura::WindowTreeClientDelegate, |
36 public aura::WindowManagerDelegate, | 36 public aura::WindowManagerDelegate, |
37 public service_manager::InterfaceFactory<mojom::WindowTreeClient> { | 37 public service_manager::InterfaceFactory<mojom::WindowTreeClient> { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Removes |window_tree_host| from |window_tree_hosts_| and deletes it. | 126 // Removes |window_tree_host| from |window_tree_hosts_| and deletes it. |
127 // Returns true on success, and false if not found, in which case | 127 // Returns true on success, and false if not found, in which case |
128 // |window_tree_host| is not deleted. | 128 // |window_tree_host| is not deleted. |
129 bool DeleteWindowTreeHost(aura::WindowTreeHostMus* window_tree_host); | 129 bool DeleteWindowTreeHost(aura::WindowTreeHostMus* window_tree_host); |
130 | 130 |
131 std::unique_ptr<aura::Env> env_; | 131 std::unique_ptr<aura::Env> env_; |
132 ::wm::WMState wm_state_; | 132 ::wm::WMState wm_state_; |
133 display::ScreenBase screen_; | 133 display::ScreenBase screen_; |
134 aura::PropertyConverter property_converter_; | 134 aura::PropertyConverter property_converter_; |
135 | 135 |
136 std::unique_ptr<GpuService> gpu_service_; | 136 std::unique_ptr<Gpu> gpu_; |
137 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; | 137 std::unique_ptr<aura::MusContextFactory> compositor_context_factory_; |
138 | 138 |
139 std::vector<std::unique_ptr<aura::WindowTreeClient>> window_tree_clients_; | 139 std::vector<std::unique_ptr<aura::WindowTreeClient>> window_tree_clients_; |
140 | 140 |
141 std::vector<std::unique_ptr<aura::WindowTreeHostMus>> window_tree_hosts_; | 141 std::vector<std::unique_ptr<aura::WindowTreeHostMus>> window_tree_hosts_; |
142 | 142 |
143 // The window server connection held by the window manager (app running at | 143 // The window server connection held by the window manager (app running at |
144 // the root window). | 144 // the root window). |
145 aura::WindowTreeClient* window_manager_ = nullptr; | 145 aura::WindowTreeClient* window_manager_ = nullptr; |
146 | 146 |
147 // A test can override the WM-related behaviour by installing its own | 147 // A test can override the WM-related behaviour by installing its own |
148 // WindowManagerDelegate during the test. | 148 // WindowManagerDelegate during the test. |
149 aura::WindowManagerDelegate* window_manager_delegate_ = nullptr; | 149 aura::WindowManagerDelegate* window_manager_delegate_ = nullptr; |
150 | 150 |
151 aura::WindowManagerClient* window_manager_client_ = nullptr; | 151 aura::WindowManagerClient* window_manager_client_ = nullptr; |
152 | 152 |
153 bool window_tree_client_lost_connection_ = false; | 153 bool window_tree_client_lost_connection_ = false; |
154 | 154 |
155 DISALLOW_COPY_AND_ASSIGN(WindowServerTestBase); | 155 DISALLOW_COPY_AND_ASSIGN(WindowServerTestBase); |
156 }; | 156 }; |
157 | 157 |
158 } // namespace ui | 158 } // namespace ui |
159 | 159 |
160 #endif // SERVICES_UI_WS_WINDOW_SERVER_TEST_BASE_H_ | 160 #endif // SERVICES_UI_WS_WINDOW_SERVER_TEST_BASE_H_ |
OLD | NEW |