qt5base-lts/tests/auto/testlib/selftests/expected_mouse.xml
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

69 lines
2.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Mouse">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
<QtBuild/>
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="timestampBetweenTestFunction">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[press, release]]></DataTag>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[press, release, hover]]></DataTag>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[hover]]></DataTag>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[hover #2]]></DataTag>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[press, release #2]]></DataTag>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[press, release, hover #2]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="stateHandlingPart1">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[dummy-1]]></DataTag>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[dummy-2]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="stateHandlingPart2">
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/mouse/tst_mouse.cpp" line="0">
<Description><![CDATA[Not implemented beyond this point!]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="deterministicEvents">
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/mouse/tst_mouse.cpp" line="0">
<DataTag><![CDATA[first-run-true]]></DataTag>
<Description><![CDATA[Not implemented!]]></Description>
</Incident>
<Incident type="skip" file="qtbase/tests/auto/testlib/selftests/mouse/tst_mouse.cpp" line="0">
<DataTag><![CDATA[first-run-false]]></DataTag>
<Description><![CDATA[Not implemented!]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="doubleClick">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>