summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-03 03:00:50 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-12-04 14:32:28 +0100
commit38313a188da3e1c644cca9826fb01b230bf8caa0 (patch)
treed62c7af7d9f0ff5d736e52f15c2b4d31d877aa36 /tests
parent79c1e8be1d3483ef14ccd23b8cc4aabce6e81f5d (diff)
parenteae93ae4495fe9bfa4f8d1e6dfd03aee04ccc281 (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/client/seatv5/tst_seatv5.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp
index 636f26081..e333082ec 100644
--- a/tests/auto/client/seatv5/tst_seatv5.cpp
+++ b/tests/auto/client/seatv5/tst_seatv5.cpp
@@ -71,6 +71,7 @@ private slots:
void singleTapFloat();
void multiTouch();
void multiTouchUpAndMotionFrame();
+ void tapAndMoveInSameFrame();
};
void tst_seatv5::bindsToSeat()
@@ -586,5 +587,37 @@ void tst_seatv5::multiTouchUpAndMotionFrame()
QVERIFY(window.m_events.empty());
}
+void tst_seatv5::tapAndMoveInSameFrame()
+{
+ TouchWindow window;
+ QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
+
+ exec([=] {
+ auto *t = touch();
+ auto *c = client();
+
+ t->sendDown(xdgToplevel()->surface(), {32, 32}, 0);
+ t->sendMotion(c, {33, 33}, 0);
+ t->sendFrame(c);
+
+ // Don't leave touch in a weird state
+ t->sendUp(c, 0);
+ t->sendFrame(c);
+ });
+
+ QTRY_VERIFY(!window.m_events.empty());
+ {
+ auto e = window.m_events.takeFirst();
+ QCOMPARE(e.type, QEvent::TouchBegin);
+ QCOMPARE(e.touchPoints.size(), 1);
+ QCOMPARE(e.touchPoints[0].state(), Qt::TouchPointState::TouchPointPressed);
+ // Position isn't that important, we just want to make sure we actually get the pressed event
+ }
+
+ // Make sure we eventually release
+ QTRY_VERIFY(!window.m_events.empty());
+ QTRY_COMPARE(window.m_events.last().touchPoints.first().state(), Qt::TouchPointState::TouchPointReleased);
+}
+
QCOMPOSITOR_TEST_MAIN(tst_seatv5)
#include "tst_seatv5.moc"