| 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 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_ | 5 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ | 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 void set_user_id(const UserId& user_id) { tree_->user_id_ = user_id; } | 75 void set_user_id(const UserId& user_id) { tree_->user_id_ = user_id; } |
| 76 void set_window_manager_internal(mojom::WindowManager* wm_internal) { | 76 void set_window_manager_internal(mojom::WindowManager* wm_internal) { |
| 77 tree_->window_manager_internal_ = wm_internal; | 77 tree_->window_manager_internal_ = wm_internal; |
| 78 } | 78 } |
| 79 void AckOldestEvent() { | 79 void AckOldestEvent() { |
| 80 tree_->OnWindowInputEventAck(tree_->event_ack_id_, | 80 tree_->OnWindowInputEventAck(tree_->event_ack_id_, |
| 81 mojom::EventResult::UNHANDLED); | 81 mojom::EventResult::UNHANDLED); |
| 82 } | 82 } |
| 83 void EnableCapture() { tree_->event_ack_id_ = 1u; } | 83 void EnableCapture() { tree_->event_ack_id_ = 1u; } |
| 84 void AckLastEvent(mojom::EventResult result) { |
| 85 tree_->OnWindowInputEventAck(tree_->event_ack_id_, result); |
| 86 } |
| 84 | 87 |
| 85 void SetEventObserver(mojom::EventMatcherPtr matcher, | 88 void SetEventObserver(mojom::EventMatcherPtr matcher, |
| 86 uint32_t event_observer_id); | 89 uint32_t event_observer_id); |
| 87 | 90 |
| 88 private: | 91 private: |
| 89 WindowTree* tree_; | 92 WindowTree* tree_; |
| 90 | 93 |
| 91 DISALLOW_COPY_AND_ASSIGN(WindowTreeTestApi); | 94 DISALLOW_COPY_AND_ASSIGN(WindowTreeTestApi); |
| 92 }; | 95 }; |
| 93 | 96 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {} | 156 explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {} |
| 154 ~WindowManagerStateTestApi() {} | 157 ~WindowManagerStateTestApi() {} |
| 155 | 158 |
| 156 void DispatchInputEventToWindow(ServerWindow* target, | 159 void DispatchInputEventToWindow(ServerWindow* target, |
| 157 ClientSpecificId client_id, | 160 ClientSpecificId client_id, |
| 158 const ui::Event& event, | 161 const ui::Event& event, |
| 159 Accelerator* accelerator) { | 162 Accelerator* accelerator) { |
| 160 wms_->DispatchInputEventToWindow(target, client_id, event, accelerator); | 163 wms_->DispatchInputEventToWindow(target, client_id, event, accelerator); |
| 161 } | 164 } |
| 162 | 165 |
| 166 ClientSpecificId GetEventTargetClientId(ServerWindow* window, |
| 167 bool in_nonclient_area) { |
| 168 return wms_->GetEventTargetClientId(window, in_nonclient_area); |
| 169 } |
| 170 |
| 171 void ProcessEvent(const ui::Event& event) { wms_->ProcessEvent(event); } |
| 172 |
| 163 void OnEventAckTimeout(ClientSpecificId client_id) { | 173 void OnEventAckTimeout(ClientSpecificId client_id) { |
| 164 wms_->OnEventAckTimeout(client_id); | 174 wms_->OnEventAckTimeout(client_id); |
| 165 } | 175 } |
| 166 | 176 |
| 167 ClientSpecificId GetEventTargetClientId(const ServerWindow* window, | 177 ClientSpecificId GetEventTargetClientId(const ServerWindow* window, |
| 168 bool in_nonclient_area) { | 178 bool in_nonclient_area) { |
| 169 return wms_->GetEventTargetClientId(window, in_nonclient_area); | 179 return wms_->GetEventTargetClientId(window, in_nonclient_area); |
| 170 } | 180 } |
| 171 | 181 |
| 172 mojom::WindowTree* tree_awaiting_input_ack() { | 182 mojom::WindowTree* tree_awaiting_input_ack() { |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); | 510 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); |
| 501 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, | 511 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, |
| 502 ServerWindow* parent, | 512 ServerWindow* parent, |
| 503 ClientWindowId* client_id); | 513 ClientWindowId* client_id); |
| 504 | 514 |
| 505 } // namespace test | 515 } // namespace test |
| 506 } // namespace ws | 516 } // namespace ws |
| 507 } // namespace mus | 517 } // namespace mus |
| 508 | 518 |
| 509 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ | 519 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| OLD | NEW |