OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/ws/test_utils.h" | 5 #include "services/ui/ws/test_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 TestWindowTreeClient::TestWindowTreeClient() | 271 TestWindowTreeClient::TestWindowTreeClient() |
272 : binding_(this), record_on_change_completed_(false) {} | 272 : binding_(this), record_on_change_completed_(false) {} |
273 TestWindowTreeClient::~TestWindowTreeClient() {} | 273 TestWindowTreeClient::~TestWindowTreeClient() {} |
274 | 274 |
275 void TestWindowTreeClient::Bind( | 275 void TestWindowTreeClient::Bind( |
276 mojo::InterfaceRequest<mojom::WindowTreeClient> request) { | 276 mojo::InterfaceRequest<mojom::WindowTreeClient> request) { |
277 binding_.Bind(std::move(request)); | 277 binding_.Bind(std::move(request)); |
278 } | 278 } |
279 | 279 |
280 void TestWindowTreeClient::OnEmbed(uint16_t client_id, | 280 void TestWindowTreeClient::OnEmbed( |
281 mojom::WindowDataPtr root, | 281 uint16_t client_id, |
282 ui::mojom::WindowTreePtr tree, | 282 mojom::WindowDataPtr root, |
283 int64_t display_id, | 283 ui::mojom::WindowTreePtr tree, |
284 Id focused_window_id, | 284 int64_t display_id, |
285 bool drawn, | 285 Id focused_window_id, |
286 const cc::FrameSinkId& frame_sink_id) { | 286 bool drawn, |
| 287 const cc::FrameSinkId& frame_sink_id, |
| 288 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
287 // TODO(sky): add test coverage of |focused_window_id|. | 289 // TODO(sky): add test coverage of |focused_window_id|. |
288 tracker_.OnEmbed(client_id, std::move(root), drawn, frame_sink_id); | 290 tracker_.OnEmbed(client_id, std::move(root), drawn, frame_sink_id); |
289 } | 291 } |
290 | 292 |
291 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { | 293 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { |
292 tracker_.OnEmbeddedAppDisconnected(window); | 294 tracker_.OnEmbeddedAppDisconnected(window); |
293 } | 295 } |
294 | 296 |
295 void TestWindowTreeClient::OnUnembed(Id window_id) { | 297 void TestWindowTreeClient::OnUnembed(Id window_id) { |
296 tracker_.OnUnembed(window_id); | 298 tracker_.OnUnembed(window_id); |
297 } | 299 } |
298 | 300 |
299 void TestWindowTreeClient::OnCaptureChanged(Id new_capture_window_id, | 301 void TestWindowTreeClient::OnCaptureChanged(Id new_capture_window_id, |
300 Id old_capture_window_id) { | 302 Id old_capture_window_id) { |
301 tracker_.OnCaptureChanged(new_capture_window_id, old_capture_window_id); | 303 tracker_.OnCaptureChanged(new_capture_window_id, old_capture_window_id); |
302 } | 304 } |
303 | 305 |
304 void TestWindowTreeClient::OnFrameSinkIdAllocated( | 306 void TestWindowTreeClient::OnFrameSinkIdAllocated( |
305 Id window_id, | 307 Id window_id, |
306 const cc::FrameSinkId& frame_sink_id) { | 308 const cc::FrameSinkId& frame_sink_id) { |
307 tracker_.OnFrameSinkIdAllocated(window_id, frame_sink_id); | 309 tracker_.OnFrameSinkIdAllocated(window_id, frame_sink_id); |
308 } | 310 } |
309 | 311 |
310 void TestWindowTreeClient::OnTopLevelCreated( | 312 void TestWindowTreeClient::OnTopLevelCreated( |
311 uint32_t change_id, | 313 uint32_t change_id, |
312 mojom::WindowDataPtr data, | 314 mojom::WindowDataPtr data, |
313 int64_t display_id, | 315 int64_t display_id, |
314 bool drawn, | 316 bool drawn, |
315 const cc::FrameSinkId& frame_sink_id) { | 317 const cc::FrameSinkId& frame_sink_id, |
| 318 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
316 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn, frame_sink_id); | 319 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn, frame_sink_id); |
317 } | 320 } |
318 | 321 |
319 void TestWindowTreeClient::OnWindowBoundsChanged( | 322 void TestWindowTreeClient::OnWindowBoundsChanged( |
320 uint32_t window, | 323 uint32_t window, |
321 const gfx::Rect& old_bounds, | 324 const gfx::Rect& old_bounds, |
322 const gfx::Rect& new_bounds, | 325 const gfx::Rect& new_bounds, |
323 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { | 326 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
324 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), | 327 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), |
325 std::move(new_bounds), local_surface_id); | 328 std::move(new_bounds), local_surface_id); |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 if (!tree->AddWindow(parent_client_id, client_window_id)) | 665 if (!tree->AddWindow(parent_client_id, client_window_id)) |
663 return nullptr; | 666 return nullptr; |
664 if (client_id) | 667 if (client_id) |
665 *client_id = client_window_id; | 668 *client_id = client_window_id; |
666 return tree->GetWindowByClientId(client_window_id); | 669 return tree->GetWindowByClientId(client_window_id); |
667 } | 670 } |
668 | 671 |
669 } // namespace test | 672 } // namespace test |
670 } // namespace ws | 673 } // namespace ws |
671 } // namespace ui | 674 } // namespace ui |
OLD | NEW |