qt5base-lts/tests/auto/testlib/selftests/expected_mouse.tap
Shawn Rutledge 0f94430a0f testlib: make it possible to test double-clicks with discrete events
The timestamp will no longer be incremented by 500ms after a mouse
release if the delay has been explicitly specified.

The default delay is 1 ms since f5010c49a3
but the running timestamp was unconditionally post-incremented by 500ms
after every mouse release, to prevent double-clicks, which were always
deemed as unintended (because we have a mouseDClick function for that).
Now, we do that 500ms increment only if the user has not provided a
delay value in the function argument at all. We have often found it
useful in our own tests to generate double-clicks "the hard way", by
sending indivdual events, so as to be able to check state in some target
object at each step, as shown in the new snippet.

[ChangeLog][QtTest] QTest::mouseRelease() and mouseClick() can now be
used to test double-clicks, by specifying a realistic timestamp delay.

Fixes: QTBUG-102441
Change-Id: I8e8d242061f79efb4c6e02638645e03661a9cd92
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-10-16 08:36:03 +02:00

21 lines
728 B
Plaintext

TAP version 13
# tst_Mouse
ok 1 - initTestCase()
ok 2 - timestampBetweenTestFunction(press, release)
ok 3 - timestampBetweenTestFunction(press, release, hover)
ok 4 - timestampBetweenTestFunction(hover)
ok 5 - timestampBetweenTestFunction(hover #2)
ok 6 - timestampBetweenTestFunction(press, release #2)
ok 7 - timestampBetweenTestFunction(press, release, hover #2)
ok 8 - stateHandlingPart1(dummy-1)
ok 9 - stateHandlingPart1(dummy-2)
ok 10 - stateHandlingPart2() # SKIP Not implemented beyond this point!
ok 11 - deterministicEvents(first-run-true) # SKIP Not implemented!
ok 12 - deterministicEvents(first-run-false) # SKIP Not implemented!
ok 13 - doubleClick()
ok 14 - cleanupTestCase()
1..14
# tests 14
# pass 11
# fail 0