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 SERVICES_UI_WS_TEST_UTILS_H_ | 5 #ifndef SERVICES_UI_WS_TEST_UTILS_H_ |
6 #define SERVICES_UI_WS_TEST_UTILS_H_ | 6 #define SERVICES_UI_WS_TEST_UTILS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 void AckOldestEvent() { | 97 void AckOldestEvent() { |
98 tree_->OnWindowInputEventAck(tree_->event_ack_id_, | 98 tree_->OnWindowInputEventAck(tree_->event_ack_id_, |
99 mojom::EventResult::UNHANDLED); | 99 mojom::EventResult::UNHANDLED); |
100 } | 100 } |
101 void EnableCapture() { tree_->event_ack_id_ = 1u; } | 101 void EnableCapture() { tree_->event_ack_id_ = 1u; } |
102 void AckLastEvent(mojom::EventResult result) { | 102 void AckLastEvent(mojom::EventResult result) { |
103 tree_->OnWindowInputEventAck(tree_->event_ack_id_, result); | 103 tree_->OnWindowInputEventAck(tree_->event_ack_id_, result); |
104 } | 104 } |
105 | 105 |
106 void SetEventObserver(mojom::EventMatcherPtr matcher, | 106 void AddEventObserver(mojom::EventMatcherPtr matcher, |
107 uint32_t event_observer_id); | 107 uint32_t event_observer_id); |
| 108 void RemoveEventObserver(uint32_t event_observer_id); |
108 | 109 |
109 private: | 110 private: |
110 WindowTree* tree_; | 111 WindowTree* tree_; |
111 | 112 |
112 DISALLOW_COPY_AND_ASSIGN(WindowTreeTestApi); | 113 DISALLOW_COPY_AND_ASSIGN(WindowTreeTestApi); |
113 }; | 114 }; |
114 | 115 |
115 // ----------------------------------------------------------------------------- | 116 // ----------------------------------------------------------------------------- |
116 | 117 |
117 class DisplayTestApi { | 118 class DisplayTestApi { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 void OnWindowOpacityChanged(uint32_t window, | 359 void OnWindowOpacityChanged(uint32_t window, |
359 float old_opacity, | 360 float old_opacity, |
360 float new_opacity) override; | 361 float new_opacity) override; |
361 void OnWindowParentDrawnStateChanged(uint32_t window, bool drawn) override; | 362 void OnWindowParentDrawnStateChanged(uint32_t window, bool drawn) override; |
362 void OnWindowSharedPropertyChanged(uint32_t window, | 363 void OnWindowSharedPropertyChanged(uint32_t window, |
363 const mojo::String& name, | 364 const mojo::String& name, |
364 mojo::Array<uint8_t> new_data) override; | 365 mojo::Array<uint8_t> new_data) override; |
365 void OnWindowInputEvent(uint32_t event_id, | 366 void OnWindowInputEvent(uint32_t event_id, |
366 uint32_t window, | 367 uint32_t window, |
367 std::unique_ptr<ui::Event> event, | 368 std::unique_ptr<ui::Event> event, |
368 uint32_t event_observer_id) override; | 369 mojo::Array<uint32_t> event_observer_id) override; |
369 void OnEventObserved(std::unique_ptr<ui::Event> event, | 370 void OnEventObserved(std::unique_ptr<ui::Event> event, |
370 uint32_t event_observer_id) override; | 371 mojo::Array<uint32_t> event_observer_id) override; |
371 void OnWindowFocused(uint32_t focused_window_id) override; | 372 void OnWindowFocused(uint32_t focused_window_id) override; |
372 void OnWindowPredefinedCursorChanged(uint32_t window_id, | 373 void OnWindowPredefinedCursorChanged(uint32_t window_id, |
373 mojom::Cursor cursor_id) override; | 374 mojom::Cursor cursor_id) override; |
374 void OnChangeCompleted(uint32_t change_id, bool success) override; | 375 void OnChangeCompleted(uint32_t change_id, bool success) override; |
375 void RequestClose(uint32_t window_id) override; | 376 void RequestClose(uint32_t window_id) override; |
376 void GetWindowManager( | 377 void GetWindowManager( |
377 mojo::AssociatedInterfaceRequest<mojom::WindowManager> internal) override; | 378 mojo::AssociatedInterfaceRequest<mojom::WindowManager> internal) override; |
378 | 379 |
379 TestChangeTracker tracker_; | 380 TestChangeTracker tracker_; |
380 mojo::Binding<mojom::WindowTreeClient> binding_; | 381 mojo::Binding<mojom::WindowTreeClient> binding_; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); | 537 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); |
537 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, | 538 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, |
538 ServerWindow* parent, | 539 ServerWindow* parent, |
539 ClientWindowId* client_id); | 540 ClientWindowId* client_id); |
540 | 541 |
541 } // namespace test | 542 } // namespace test |
542 } // namespace ws | 543 } // namespace ws |
543 } // namespace ui | 544 } // namespace ui |
544 | 545 |
545 #endif // SERVICES_UI_WS_TEST_UTILS_H_ | 546 #endif // SERVICES_UI_WS_TEST_UTILS_H_ |
OLD | NEW |