-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[unittests] Send Mouse events via DisplayServer instead of push_input #71972
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't reviewed it properly yet, but at a first glimpse it looks great! I wouldn't, however, call it DisplayServerTests
. Since it's basically a mock object I think that DisplayServerMock
would be more descriptive.
b3019b2
to
381f4e4
Compare
Currently Unittests simplify mouse-events by just pushing them to Viewports. For dealing with mouse-screen-coordinates (caused by the introduction of multiple native Windows) it becomes necessary to extend the DisplayServer functionality for unittests. This PR introduces DisplayServerMock based on DisplayServerHeadless, which additionally supports basic Mouse-Input handling.
381f4e4
to
7de1b1a
Compare
Haven't reviewed yet, but is there any reason why we wouldn't want to implement this mock support directly in DisplayServerHeadless? |
I also thought about this but took this safe approach with a new class, because I am not familiar with where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved in PR review meeting.
Thanks! |
Currently Unittests simplify mouse-events by just pushing them to Viewports. For dealing with mouse-screen-coordinates (caused by the introduction of multiple native Windows) it becomes necessary to extend the DisplayServer functionality for unittests.
This PR introduces
DisplayServerMock
based onDisplayServerHeadless
, which additionally supports basic Mouse-Input handling.This functionality is required for:
Updated 2023-01-29: Renamed
DisplayServerTests
toDisplayServerMock
.