summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenu/tst_qmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmenu/tst_qmenu.cpp')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index b3c41e1c2b..73a74c6d75 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -827,6 +827,9 @@ void tst_QMenu::task258920_mouseBorder()
#ifdef Q_OS_WINCE_WM
QSKIP("Mouse move related signals for Windows Mobile unavailable", SkipAll);
#endif
+#ifdef Q_WS_QPA
+ QSKIP("QTBUG-20753 QCursor::setPos() / QTest::mouseMove() doesn't work on qpa", SkipAll);
+#endif
Menu258920 menu;
// On Symbian, styleHint(QStyle::SH_Menu_MouseTracking) in QS60Style is false.
// For other styles which inherit from QWindowsStyle, the value is true.
@@ -880,12 +883,27 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow()
b.show();
const QRect screen = QApplication::desktop()->screenGeometry(scrNumber);
- b.move(10, screen.bottom()-b.height()-5);
+ QRect desiredGeometry = b.geometry();
+ desiredGeometry.moveTopLeft(QPoint(10, screen.bottom()-b.height()-5));
+
+ b.setGeometry(desiredGeometry);
QTest::qWaitForWindowShown(&b);
+
+ if (b.geometry() != desiredGeometry) {
+ // We are trying to put the button very close to the edge of the screen,
+ // explicitly to test behavior when the popup menu goes off the screen.
+ // However a modern window manager is quite likely to reject this requested geometry
+ // (kwin in kde4 does, for example, since the button would probably appear behind
+ // or partially behind the taskbar).
+ // Your best bet is to run this test _without_ a WM.
+ QSKIP("Your window manager won't allow a window against the bottom of the screen", SkipAll);
+ }
+
QTimer::singleShot(300,lastMenu, SLOT(hide()));
QTest::mouseClick(&b, Qt::LeftButton, Qt::NoModifier, b.rect().center());
QVERIFY(!lastMenu->geometry().intersects(b.geometry()));
+ // note: we're assuming that, if we previously got the desired geometry, we'll get it here too
b.move(10, screen.bottom()-lastMenu->height()-5);
QTimer::singleShot(300,lastMenu, SLOT(hide()));
QTest::mouseClick(&b, Qt::LeftButton, Qt::NoModifier, b.rect().center());