summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp13
1 files 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 <qobject.h>
+#include "../../shared/util.h"
+
QT_FORWARD_DECLARE_CLASS(QMainWindow)
#include <qmenubar.h>
@@ -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());
}