Stabilize tst_qtouchevent.

- Use QTRY_COMPARE() in touchBeginWithGraphicsWidget.
- Change raw event translation tests to wait for the
  window to become active to avoid WM positioning issues.
- Blacklist the raw event translation tests on Linux.

Task-number: QTBUG-46266
Change-Id: I73aae375ee279a518a2a083d0ce8919cce474cb3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
bb10
Friedemann Kleint 2015-06-01 09:58:59 +02:00
parent 0e1b4e896f
commit 6fba3c1904
2 changed files with 10 additions and 4 deletions

View File

@ -0,0 +1,6 @@
[basicRawEventTranslation]
linux
[multiPointRawEventTranslationOnTouchScreen]
linux
[multiPointRawEventTranslationOnTouchPad]
linux

View File

@ -601,7 +601,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
touchWidget.setAttribute(Qt::WA_AcceptTouchEvents);
touchWidget.setGeometry(100, 100, 400, 300);
touchWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&touchWidget));
QVERIFY(QTest::qWaitForWindowActive(&touchWidget));
QPointF pos = touchWidget.rect().center();
QPointF screenPos = touchWidget.mapToGlobal(pos.toPoint());
@ -738,7 +738,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rightWidget.setGeometry(300, 100, 100, 100);
touchWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&touchWidget));
QVERIFY(QTest::qWaitForWindowActive(&touchWidget));
QPointF leftPos = leftWidget.rect().center();
QPointF rightPos = rightWidget.rect().center();
@ -968,7 +968,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rightWidget.setGeometry(300, 100, 100, 100);
touchWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&touchWidget));
QVERIFY(QTest::qWaitForWindowActive(&touchWidget));
QPointF leftPos = leftWidget.rect().center();
QPointF rightPos = rightWidget.rect().center();
@ -1468,7 +1468,7 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
.release(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport())
.release(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
QCOMPARE(root->touchBeginCounter, 1);
QTRY_COMPARE(root->touchBeginCounter, 1);
QCOMPARE(root->touchUpdateCounter, 1);
QCOMPARE(root->touchEndCounter, 1);
QCOMPARE(root->touchUpdatePoints.size(), 2);