From e3f3ced70f80369439200b7d7bc3e4e11222c81f Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 6 Aug 2009 12:36:14 +0200 Subject: task256322_highlight() failed due to lack of delays before QVERIFYs. Last QVERIFY still failing. Reviewed-by: olivier --- tests/auto/qmenubar/tst_qmenubar.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 1245de1..67e088b 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -59,6 +59,8 @@ #include +#include "../../shared/util.h" + QT_FORWARD_DECLARE_CLASS(QMainWindow) #include @@ -1536,25 +1538,26 @@ void tst_QMenuBar::task256322_highlight() QAction *nothing = win.menuBar()->addAction("nothing"); win.show(); + QTest::qWait(50); + QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file).center()); QTest::mouseClick(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center()); - QVERIFY(menu.isVisible()); + QTRY_VERIFY(menu.isVisible()); QVERIFY(!menu2.isVisible()); QCOMPARE(win.menuBar()->activeAction(), file); QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file2).center()); - QVERIFY(!menu.isVisible()); + QTRY_VERIFY(!menu.isVisible()); QVERIFY(menu2.isVisible()); QCOMPARE(win.menuBar()->activeAction(), file2); QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(nothing).center()); + QTRY_VERIFY(!menu2.isVisible()); QVERIFY(!menu.isVisible()); - QVERIFY(!menu2.isVisible()); QCOMPARE(win.menuBar()->activeAction(), nothing); QTest::mouseMove(&win, win.menuBar()->geometry().bottomLeft() + QPoint(1,1)); - - QVERIFY(!menu.isVisible()); + QTRY_VERIFY(!menu.isVisible()); QVERIFY(!menu2.isVisible()); QVERIFY(!win.menuBar()->activeAction()); } -- cgit v0.12