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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 TestClientConnection* last_connection() { return last_connection_; } | 186 TestClientConnection* last_connection() { return last_connection_; } |
187 | 187 |
188 private: | 188 private: |
189 // ConnectionManagerDelegate: | 189 // ConnectionManagerDelegate: |
190 void OnNoMoreRootConnections() override {} | 190 void OnNoMoreRootConnections() override {} |
191 | 191 |
192 ClientConnection* CreateClientConnectionForEmbedAtWindow( | 192 ClientConnection* CreateClientConnectionForEmbedAtWindow( |
193 ConnectionManager* connection_manager, | 193 ConnectionManager* connection_manager, |
194 mojo::InterfaceRequest<mus::mojom::WindowTree> service_request, | 194 mojo::InterfaceRequest<mus::mojom::WindowTree> service_request, |
195 ConnectionSpecificId creator_id, | |
196 const WindowId& root_id, | 195 const WindowId& root_id, |
197 uint32_t policy_bitmask, | 196 uint32_t policy_bitmask, |
198 mus::mojom::WindowTreeClientPtr client) override { | 197 mus::mojom::WindowTreeClientPtr client) override { |
199 // Used by ConnectionManager::AddRoot. | 198 // Used by ConnectionManager::AddRoot. |
200 scoped_ptr<WindowTreeImpl> service(new WindowTreeImpl( | 199 scoped_ptr<WindowTreeImpl> service( |
201 connection_manager, creator_id, root_id, policy_bitmask)); | 200 new WindowTreeImpl(connection_manager, root_id, policy_bitmask)); |
202 last_connection_ = new TestClientConnection(std::move(service)); | 201 last_connection_ = new TestClientConnection(std::move(service)); |
203 return last_connection_; | 202 return last_connection_; |
204 } | 203 } |
205 | 204 |
206 TestClientConnection* last_connection_; | 205 TestClientConnection* last_connection_; |
207 | 206 |
208 DISALLOW_COPY_AND_ASSIGN(TestConnectionManagerDelegate); | 207 DISALLOW_COPY_AND_ASSIGN(TestConnectionManagerDelegate); |
209 }; | 208 }; |
210 | 209 |
211 // ----------------------------------------------------------------------------- | 210 // ----------------------------------------------------------------------------- |
212 | 211 |
213 class TestWindowTreeHostConnection : public WindowTreeHostConnection { | 212 class TestWindowTreeHostConnection : public WindowTreeHostConnection { |
214 public: | 213 public: |
215 TestWindowTreeHostConnection(scoped_ptr<WindowTreeHostImpl> host_impl, | 214 TestWindowTreeHostConnection(scoped_ptr<WindowTreeHostImpl> host_impl, |
216 ConnectionManager* manager) | 215 ConnectionManager* manager) |
217 : WindowTreeHostConnection(std::move(host_impl), manager) {} | 216 : WindowTreeHostConnection(std::move(host_impl), manager) {} |
218 ~TestWindowTreeHostConnection() override {} | 217 ~TestWindowTreeHostConnection() override {} |
219 | 218 |
220 private: | 219 private: |
221 // WindowTreeHostDelegate: | 220 // WindowTreeHostDelegate: |
222 void OnDisplayInitialized() override { | 221 void OnDisplayInitialized() override { |
223 connection_manager()->AddHost(this); | 222 connection_manager()->AddHost(this); |
224 set_window_tree(connection_manager()->EmbedAtWindow( | 223 set_window_tree(connection_manager()->EmbedAtWindow( |
225 kInvalidConnectionId, window_tree_host()->root_window()->id(), | 224 window_tree_host()->root_window()->id(), |
226 mus::mojom::WindowTree::ACCESS_POLICY_EMBED_ROOT, | 225 mus::mojom::WindowTree::ACCESS_POLICY_EMBED_ROOT, |
227 mus::mojom::WindowTreeClientPtr())); | 226 mus::mojom::WindowTreeClientPtr())); |
228 } | 227 } |
229 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeHostConnection); | 228 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeHostConnection); |
230 }; | 229 }; |
231 | 230 |
232 // ----------------------------------------------------------------------------- | 231 // ----------------------------------------------------------------------------- |
233 // Empty implementation of DisplayManager. | 232 // Empty implementation of DisplayManager. |
234 class TestDisplayManager : public DisplayManager { | 233 class TestDisplayManager : public DisplayManager { |
235 public: | 234 public: |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 // Ack the first event. That should trigger the dispatch of the second event. | 715 // Ack the first event. That should trigger the dispatch of the second event. |
717 AckPreviousEvent(); | 716 AckPreviousEvent(); |
718 ASSERT_EQ(1u, wm_client()->tracker()->changes()->size()); | 717 ASSERT_EQ(1u, wm_client()->tracker()->changes()->size()); |
719 EXPECT_EQ("InputEvent window=0,2 event_action=5", | 718 EXPECT_EQ("InputEvent window=0,2 event_action=5", |
720 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); | 719 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); |
721 } | 720 } |
722 | 721 |
723 } // namespace ws | 722 } // namespace ws |
724 | 723 |
725 } // namespace mus | 724 } // namespace mus |
OLD | NEW |