summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-08-12 14:00:38 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-17 03:34:12 +0200
commit94b6f1ad52e967961c034b6954df25ab86bb962b (patch)
treee546e451a925edfd5fcf7723899fd1a689c72b91 /tests
parent7465b55d9c1c8586da7384fbf97604ed020a4fd3 (diff)
test: skip tst_QMenu::pushButtonPopulateOnAboutToShow() for picky WM
We are trying to test the case of having a widget right next to the edge of the screen, but the window manager is likely to forbid this geometry in many cases. When this happens, we can't continue the test. Change-Id: I6bce2263bdf444221c5303e83d70a254bbb9194c Reviewed-on: http://codereview.qt.nokia.com/2892 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index 331f0e9a2d..73a74c6d75 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -883,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());