From 2a289d19472b196b267d8747dcb23b20b82e1997 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 10 Jul 2015 15:27:27 +0200 Subject: [PATCH] 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 --- .../auto/widgets/kernel/qapplication/tst_qapplication.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 15532bf4fd..84956d0a02 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -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);