diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-24 03:03:15 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-24 03:03:15 +0200 |
commit | fc6ee24ac1bf94ca99b6629f00d047131d424e87 (patch) | |
tree | b55885d34dc9ba49c880467ec823dd4674a6733e /tests/auto/client/seatv5/tst_seatv5.cpp | |
parent | 7fa3a9c2f181323513733ceaac196579730be600 (diff) | |
parent | da371debb1bcc4a22c5157b0d8a2e09a7cb7ce1b (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I3bbf053a35ceee52d9953a676bacec2b9299bad5
Diffstat (limited to 'tests/auto/client/seatv5/tst_seatv5.cpp')
-rw-r--r-- | tests/auto/client/seatv5/tst_seatv5.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/client/seatv5/tst_seatv5.cpp b/tests/auto/client/seatv5/tst_seatv5.cpp index ca8de31ac..ae7c3db2f 100644 --- a/tests/auto/client/seatv5/tst_seatv5.cpp +++ b/tests/auto/client/seatv5/tst_seatv5.cpp @@ -68,6 +68,7 @@ private slots: // Touch tests void createsTouch(); void singleTap(); + void singleTapFloat(); }; void tst_seatv5::bindsToSeat() @@ -431,5 +432,36 @@ void tst_seatv5::singleTap() } } +void tst_seatv5::singleTapFloat() +{ + TouchWindow window; + QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); + + exec([=] { + auto *t = touch(); + auto *c = client(); + t->sendDown(xdgToplevel()->surface(), {32.75, 32.25}, 1); + t->sendFrame(c); + t->sendUp(c, 1); + t->sendFrame(c); + }); + + QTRY_VERIFY(!window.m_events.empty()); + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchBegin); + QCOMPARE(e.touchPointStates, Qt::TouchPointState::TouchPointPressed); + QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.first().pos(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top())); + } + { + auto e = window.m_events.takeFirst(); + QCOMPARE(e.type, QEvent::TouchEnd); + QCOMPARE(e.touchPointStates, Qt::TouchPointState::TouchPointReleased); + QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.first().pos(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top())); + } +} + QCOMPOSITOR_TEST_MAIN(tst_seatv5) #include "tst_seatv5.moc" |