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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 TestWindowManager::~TestWindowManager() {} | 219 TestWindowManager::~TestWindowManager() {} |
220 | 220 |
221 void TestWindowManager::OnConnect(uint16_t client_id) { | 221 void TestWindowManager::OnConnect(uint16_t client_id) { |
222 connect_count_++; | 222 connect_count_++; |
223 } | 223 } |
224 | 224 |
225 void TestWindowManager::WmNewDisplayAdded( | 225 void TestWindowManager::WmNewDisplayAdded( |
226 const display::Display& display, | 226 const display::Display& display, |
227 ui::mojom::WindowDataPtr root, | 227 ui::mojom::WindowDataPtr root, |
228 bool drawn, | 228 bool drawn, |
229 const cc::FrameSinkId& frame_sink_id, | |
230 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { | 229 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
231 display_added_count_++; | 230 display_added_count_++; |
232 } | 231 } |
233 | 232 |
234 void TestWindowManager::WmDisplayRemoved(int64_t display_id) { | 233 void TestWindowManager::WmDisplayRemoved(int64_t display_id) { |
235 got_display_removed_ = true; | 234 got_display_removed_ = true; |
236 display_removed_id_ = display_id; | 235 display_removed_id_ = display_id; |
237 } | 236 } |
238 | 237 |
239 void TestWindowManager::WmSetModalType(uint32_t window_id, ui::ModalType type) { | 238 void TestWindowManager::WmSetModalType(uint32_t window_id, ui::ModalType type) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 binding_.Bind(std::move(request)); | 298 binding_.Bind(std::move(request)); |
300 } | 299 } |
301 | 300 |
302 void TestWindowTreeClient::OnEmbed( | 301 void TestWindowTreeClient::OnEmbed( |
303 uint16_t client_id, | 302 uint16_t client_id, |
304 mojom::WindowDataPtr root, | 303 mojom::WindowDataPtr root, |
305 ui::mojom::WindowTreePtr tree, | 304 ui::mojom::WindowTreePtr tree, |
306 int64_t display_id, | 305 int64_t display_id, |
307 Id focused_window_id, | 306 Id focused_window_id, |
308 bool drawn, | 307 bool drawn, |
309 const cc::FrameSinkId& frame_sink_id, | |
310 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { | 308 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
311 // TODO(sky): add test coverage of |focused_window_id|. | 309 // TODO(sky): add test coverage of |focused_window_id|. |
312 tracker_.OnEmbed(client_id, std::move(root), drawn, frame_sink_id); | 310 tracker_.OnEmbed(client_id, std::move(root), drawn); |
313 } | 311 } |
314 | 312 |
315 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { | 313 void TestWindowTreeClient::OnEmbeddedAppDisconnected(uint32_t window) { |
316 tracker_.OnEmbeddedAppDisconnected(window); | 314 tracker_.OnEmbeddedAppDisconnected(window); |
317 } | 315 } |
318 | 316 |
319 void TestWindowTreeClient::OnUnembed(Id window_id) { | 317 void TestWindowTreeClient::OnUnembed(Id window_id) { |
320 tracker_.OnUnembed(window_id); | 318 tracker_.OnUnembed(window_id); |
321 } | 319 } |
322 | 320 |
323 void TestWindowTreeClient::OnCaptureChanged(Id new_capture_window_id, | 321 void TestWindowTreeClient::OnCaptureChanged(Id new_capture_window_id, |
324 Id old_capture_window_id) { | 322 Id old_capture_window_id) { |
325 tracker_.OnCaptureChanged(new_capture_window_id, old_capture_window_id); | 323 tracker_.OnCaptureChanged(new_capture_window_id, old_capture_window_id); |
326 } | 324 } |
327 | 325 |
328 void TestWindowTreeClient::OnFrameSinkIdAllocated( | 326 void TestWindowTreeClient::OnFrameSinkIdAllocated( |
329 Id window_id, | 327 Id window_id, |
330 const cc::FrameSinkId& frame_sink_id) { | 328 const cc::FrameSinkId& frame_sink_id) { |
331 tracker_.OnFrameSinkIdAllocated(window_id, frame_sink_id); | 329 tracker_.OnFrameSinkIdAllocated(window_id, frame_sink_id); |
332 } | 330 } |
333 | 331 |
334 void TestWindowTreeClient::OnTopLevelCreated( | 332 void TestWindowTreeClient::OnTopLevelCreated( |
335 uint32_t change_id, | 333 uint32_t change_id, |
336 mojom::WindowDataPtr data, | 334 mojom::WindowDataPtr data, |
337 int64_t display_id, | 335 int64_t display_id, |
338 bool drawn, | 336 bool drawn, |
339 const cc::FrameSinkId& frame_sink_id, | |
340 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { | 337 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
341 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn, frame_sink_id); | 338 tracker_.OnTopLevelCreated(change_id, std::move(data), drawn); |
342 } | 339 } |
343 | 340 |
344 void TestWindowTreeClient::OnWindowBoundsChanged( | 341 void TestWindowTreeClient::OnWindowBoundsChanged( |
345 uint32_t window, | 342 uint32_t window, |
346 const gfx::Rect& old_bounds, | 343 const gfx::Rect& old_bounds, |
347 const gfx::Rect& new_bounds, | 344 const gfx::Rect& new_bounds, |
348 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { | 345 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
349 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), | 346 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), |
350 std::move(new_bounds), local_surface_id); | 347 std::move(new_bounds), local_surface_id); |
351 } | 348 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 if (!tree->AddWindow(parent_client_id, client_window_id)) | 685 if (!tree->AddWindow(parent_client_id, client_window_id)) |
689 return nullptr; | 686 return nullptr; |
690 if (client_id) | 687 if (client_id) |
691 *client_id = client_window_id; | 688 *client_id = client_window_id; |
692 return tree->GetWindowByClientId(client_window_id); | 689 return tree->GetWindowByClientId(client_window_id); |
693 } | 690 } |
694 | 691 |
695 } // namespace test | 692 } // namespace test |
696 } // namespace ws | 693 } // namespace ws |
697 } // namespace ui | 694 } // namespace ui |
OLD | NEW |