summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel/qscreen/tst_qscreen.cpp')
-rw-r--r--tests/auto/gui/kernel/qscreen/tst_qscreen.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
index cc08379251..5567f127c9 100644
--- a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
+++ b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
@@ -185,19 +185,34 @@ void tst_QScreen::orientationChange()
screen->setOrientationUpdateMask(Qt::LandscapeOrientation | Qt::PortraitOrientation);
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation);
+ QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::LandscapeOrientation);
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::PortraitOrientation);
+ QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::PortraitOrientation);
QSignalSpy spy(screen, SIGNAL(orientationChanged(Qt::ScreenOrientation)));
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::InvertedLandscapeOrientation);
+ QWindowSystemInterface::flushWindowSystemEvents();
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::InvertedPortraitOrientation);
+ QWindowSystemInterface::flushWindowSystemEvents();
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation);
+ QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::LandscapeOrientation);
QCOMPARE(spy.count(), 1);
+
+ spy.clear();
+ QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::InvertedLandscapeOrientation);
+ QWindowSystemInterface::flushWindowSystemEvents();
+ QTRY_COMPARE(screen->orientation(), Qt::LandscapeOrientation);
+ QCOMPARE(spy.count(), 0);
+
+ screen->setOrientationUpdateMask(screen->orientationUpdateMask() | Qt::InvertedLandscapeOrientation);
+ QTRY_COMPARE(screen->orientation(), Qt::InvertedLandscapeOrientation);
+ QCOMPARE(spy.count(), 1);
}
#include <tst_qscreen.moc>