| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() { | 144 const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() { |
| 145 return metrics_; | 145 return metrics_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // WindowTreeTestApi --------------------------------------------------------- | 148 // WindowTreeTestApi --------------------------------------------------------- |
| 149 | 149 |
| 150 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} | 150 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} |
| 151 WindowTreeTestApi::~WindowTreeTestApi() {} | 151 WindowTreeTestApi::~WindowTreeTestApi() {} |
| 152 | 152 |
| 153 void WindowTreeTestApi::StartPointerWatcher(bool want_moves, | 153 void WindowTreeTestApi::StartPointerWatcher(bool want_moves) { |
| 154 uint32_t pointer_watcher_id) { | 154 tree_->StartPointerWatcher(want_moves); |
| 155 tree_->StartPointerWatcher(want_moves, pointer_watcher_id); | |
| 156 } | 155 } |
| 157 | 156 |
| 158 void WindowTreeTestApi::StopPointerWatcher() { | 157 void WindowTreeTestApi::StopPointerWatcher() { |
| 159 tree_->StopPointerWatcher(); | 158 tree_->StopPointerWatcher(); |
| 160 } | 159 } |
| 161 | 160 |
| 162 // DisplayTestApi ------------------------------------------------------------ | 161 // DisplayTestApi ------------------------------------------------------------ |
| 163 | 162 |
| 164 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} | 163 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} |
| 165 DisplayTestApi::~DisplayTestApi() {} | 164 DisplayTestApi::~DisplayTestApi() {} |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 void TestWindowTreeClient::OnWindowSharedPropertyChanged( | 322 void TestWindowTreeClient::OnWindowSharedPropertyChanged( |
| 324 uint32_t window, | 323 uint32_t window, |
| 325 const mojo::String& name, | 324 const mojo::String& name, |
| 326 mojo::Array<uint8_t> new_data) { | 325 mojo::Array<uint8_t> new_data) { |
| 327 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); | 326 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); |
| 328 } | 327 } |
| 329 | 328 |
| 330 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, | 329 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
| 331 uint32_t window, | 330 uint32_t window, |
| 332 std::unique_ptr<ui::Event> event, | 331 std::unique_ptr<ui::Event> event, |
| 333 uint32_t event_observer_id) { | 332 bool matches_pointer_watcher) { |
| 334 tracker_.OnWindowInputEvent(window, *event.get(), event_observer_id); | 333 tracker_.OnWindowInputEvent(window, *event.get(), matches_pointer_watcher); |
| 335 } | 334 } |
| 336 | 335 |
| 337 void TestWindowTreeClient::OnPointerEventObserved( | 336 void TestWindowTreeClient::OnPointerEventObserved( |
| 338 std::unique_ptr<ui::Event> event, | 337 std::unique_ptr<ui::Event> event, |
| 339 uint32_t event_observer_id, | |
| 340 uint32_t window_id) { | 338 uint32_t window_id) { |
| 341 tracker_.OnPointerEventObserved(*event.get(), event_observer_id, window_id); | 339 tracker_.OnPointerEventObserved(*event.get(), window_id); |
| 342 } | 340 } |
| 343 | 341 |
| 344 void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) { | 342 void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) { |
| 345 tracker_.OnWindowFocused(focused_window_id); | 343 tracker_.OnWindowFocused(focused_window_id); |
| 346 } | 344 } |
| 347 | 345 |
| 348 void TestWindowTreeClient::OnWindowPredefinedCursorChanged( | 346 void TestWindowTreeClient::OnWindowPredefinedCursorChanged( |
| 349 uint32_t window_id, | 347 uint32_t window_id, |
| 350 mojom::Cursor cursor_id) { | 348 mojom::Cursor cursor_id) { |
| 351 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id); | 349 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 return nullptr; | 542 return nullptr; |
| 545 if (!tree->AddWindow(parent_client_id, client_window_id)) | 543 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 546 return nullptr; | 544 return nullptr; |
| 547 *client_id = client_window_id; | 545 *client_id = client_window_id; |
| 548 return tree->GetWindowByClientId(client_window_id); | 546 return tree->GetWindowByClientId(client_window_id); |
| 549 } | 547 } |
| 550 | 548 |
| 551 } // namespace test | 549 } // namespace test |
| 552 } // namespace ws | 550 } // namespace ws |
| 553 } // namespace ui | 551 } // namespace ui |
| OLD | NEW |