haikuwebkit/LayoutTests/fast/events/monotonic-event-time-expect...

14 lines
406 B
Plaintext
Raw Permalink Normal View History

[WPE] Avoid possible WTR event timing going back in time and fix conversion from s to ms https://bugs.webkit.org/show_bug.cgi?id=212338 Reviewed by Michael Catanzaro. Source/WebKit: When converting the input timestamps to WallTime, we must somehow adjust them to give meaningful timestamps (due to Dom::Event conversion from timestamp wall time to the time origin from document loading). As WPE timestamps are just intended to be compared among themselves, we use the first processed event as the origin, comparing the following events to it to get an actual time. Test: fast/events/monotonic-event-time.html * Shared/libwpe/WebEventFactory.cpp: (WebKit::wallTimeForEventTime): Tools: Make sure we cast the double m_time timestamp from seconds to uint32_t milliseconds expected by WPE input events. * WebKitTestRunner/wpe/EventSenderProxyWPE.cpp: (WTR::secToMsTimestamp): (WTR::EventSenderProxy::EventSenderProxy): Use monotonic time instead of zero as the time origin. This is used only in a relative manner, and we need monotonic behavior so conversion to DOM event timestamps makes sense. (WTR::EventSenderProxy::mouseDown): (WTR::EventSenderProxy::mouseUp): (WTR::EventSenderProxy::mouseMoveTo): (WTR::EventSenderProxy::mouseScrollBy): (WTR::EventSenderProxy::updateTouchPoint): (WTR::EventSenderProxy::prepareAndDispatchTouchEvent): (WTR::EventSenderProxy::releaseTouchPoint): LayoutTests: Added new test to check if input events timestamps are actually monotonically increasing since the start. * fast/events/monotonic-event-time-expected.txt: Added. * fast/events/monotonic-event-time.html: Added. * platform/ios/TestExpectations: Skipped the test as it relies on mouseDown Canonical link: https://commits.webkit.org/225273@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-27 20:45:43 +00:00
This test checks if DOM event timestamps are monotonically increasing when leaping forward.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS lastTimeStamp < event.timeStamp is true
PASS lastTimeStamp < event.timeStamp is true
PASS lastTimeStamp < event.timeStamp is true
PASS lastTimeStamp < event.timeStamp is true
PASS successfullyParsed is true
TEST COMPLETE