Stabilize tst_QApplication::touchEventPropagation().

The test checks whether a child window receives
mouse events synthesizes from touch. Enlarge the child
window so that it fully covers the parent and move the
touch point a bit inside so that it is not affected
by window manager positioning issues.
Use QTRY_VERIFY.

FAIL!  : tst_QApplication::touchEventPropagation() 'widget.seenMouseEvent' returned FALSE. ()
     Loc: [/work/build/qt/qtbase/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp(2107)]

Change-Id: Ic08e68b1e547cc7148cd8994464fdc2a14ac507b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2015-07-10 15:27:27 +02:00
parent a847c2cb61
commit 2a289d1947

View File

@ -2088,11 +2088,12 @@ void tst_QApplication::touchEventPropagation()
window.resize(200, 200);
window.setObjectName("2. window");
TouchEventPropagationTestWidget widget(&window);
widget.resize(200, 200);
widget.setObjectName("2. widget");
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(50, 50)));
releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(50, 50)));
QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
0,
@ -2102,9 +2103,8 @@ void tst_QApplication::touchEventPropagation()
0,
device,
touchPointList(releasedTouchPoints));
QCoreApplication::processEvents();
QTRY_VERIFY(widget.seenMouseEvent);
QVERIFY(!widget.seenTouchEvent);
QVERIFY(widget.seenMouseEvent);
QVERIFY(!window.seenTouchEvent);
QVERIFY(window.seenMouseEvent);