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 <memory> | 10 #include <memory> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 // ----------------------------------------------------------------------------- | 145 // ----------------------------------------------------------------------------- |
146 | 146 |
147 class DisplayTestApi { | 147 class DisplayTestApi { |
148 public: | 148 public: |
149 explicit DisplayTestApi(Display* display); | 149 explicit DisplayTestApi(Display* display); |
150 ~DisplayTestApi(); | 150 ~DisplayTestApi(); |
151 | 151 |
152 void OnEvent(ui::Event* event) { display_->OnEventFromSource(event); } | 152 void OnEvent(ui::Event* event) { display_->OnEventFromSource(event); } |
153 | 153 |
154 const ui::CursorData& last_cursor() const { return display_->last_cursor_; } | |
155 | |
156 private: | 154 private: |
157 Display* display_; | 155 Display* display_; |
158 | 156 |
159 DISALLOW_COPY_AND_ASSIGN(DisplayTestApi); | 157 DISALLOW_COPY_AND_ASSIGN(DisplayTestApi); |
160 }; | 158 }; |
161 | 159 |
162 // ----------------------------------------------------------------------------- | 160 // ----------------------------------------------------------------------------- |
163 | 161 |
164 class EventDispatcherTestApi { | 162 class EventDispatcherTestApi { |
165 public: | 163 public: |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // ----------------------------------------------------------------------------- | 613 // ----------------------------------------------------------------------------- |
616 | 614 |
617 // Helper class which creates and sets up the necessary objects for tests that | 615 // Helper class which creates and sets up the necessary objects for tests that |
618 // use the WindowServer. | 616 // use the WindowServer. |
619 class WindowServerTestHelper { | 617 class WindowServerTestHelper { |
620 public: | 618 public: |
621 WindowServerTestHelper(); | 619 WindowServerTestHelper(); |
622 ~WindowServerTestHelper(); | 620 ~WindowServerTestHelper(); |
623 | 621 |
624 WindowServer* window_server() { return window_server_.get(); } | 622 WindowServer* window_server() { return window_server_.get(); } |
625 ui::CursorData cursor() const { return cursor_; } | 623 const ui::CursorData& cursor() const { return cursor_; } |
626 | 624 |
627 TestWindowServerDelegate* window_server_delegate() { | 625 TestWindowServerDelegate* window_server_delegate() { |
628 return &window_server_delegate_; | 626 return &window_server_delegate_; |
629 } | 627 } |
630 | 628 |
631 private: | 629 private: |
632 ui::CursorData cursor_; | 630 ui::CursorData cursor_; |
633 TestPlatformDisplayFactory platform_display_factory_; | 631 TestPlatformDisplayFactory platform_display_factory_; |
634 TestWindowServerDelegate window_server_delegate_; | 632 TestWindowServerDelegate window_server_delegate_; |
635 std::unique_ptr<WindowServer> window_server_; | 633 std::unique_ptr<WindowServer> window_server_; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 ClientWindowId* client_id = nullptr); | 725 ClientWindowId* client_id = nullptr); |
728 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, | 726 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, |
729 ServerWindow* parent, | 727 ServerWindow* parent, |
730 ClientWindowId* client_id = nullptr); | 728 ClientWindowId* client_id = nullptr); |
731 | 729 |
732 } // namespace test | 730 } // namespace test |
733 } // namespace ws | 731 } // namespace ws |
734 } // namespace ui | 732 } // namespace ui |
735 | 733 |
736 #endif // SERVICES_UI_WS_TEST_UTILS_H_ | 734 #endif // SERVICES_UI_WS_TEST_UTILS_H_ |
OLD | NEW |