From 92b717cbfb94bffbdc1a4d22f67ad359ba81a439 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 23 Sep 2009 18:22:29 +0200 Subject: Stabilize QGraphicsEffect and QToolTip test --- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 14 ++++++-------- tests/auto/qtooltip/tst_qtooltip.cpp | 9 +++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index ba3783b..0201bc4 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -48,6 +48,8 @@ #include #include +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -261,10 +263,8 @@ void tst_QGraphicsEffect::draw() QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(100); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(item->numRepaints > 0); item->reset(); // Make sure installing the effect triggers a repaint. @@ -361,10 +361,8 @@ void tst_QGraphicsEffect::opacity() QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(100); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(effect->numRepaints > 0); QCOMPARE(effect->m_opacity, qreal(0.5)); } diff --git a/tests/auto/qtooltip/tst_qtooltip.cpp b/tests/auto/qtooltip/tst_qtooltip.cpp index 2ad74a3..283effa 100644 --- a/tests/auto/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/qtooltip/tst_qtooltip.cpp @@ -112,13 +112,14 @@ void tst_QToolTip::task183679() Widget_task183679 widget; widget.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&widget); -#endif + QApplication::setActiveWindow(&widget); + QTest::qWaitForWindowShown(&widget); + QTest::qWait(30); + widget.showDelayedToolTip(100); QTest::qWait(300); - QVERIFY(QToolTip::isVisible()); + QTRY_VERIFY(QToolTip::isVisible()); QTest::keyPress(&widget, key); -- cgit v0.12