summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel')
-rw-r--r--tests/auto/gui/kernel/qscreen/tst_qscreen.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
index a168203bdd..ab798a7351 100644
--- a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
+++ b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
@@ -52,6 +52,7 @@ private slots:
void angleBetween();
void transformBetween_data();
void transformBetween();
+ void orientationChange();
};
void tst_QScreen::angleBetween_data()
@@ -163,5 +164,16 @@ void tst_QScreen::transformBetween()
QCOMPARE(QScreen::transformBetween(a, b, rect), expected);
}
+void tst_QScreen::orientationChange()
+{
+ QScreen *screen = QGuiApplication::primaryScreen();
+
+ QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation);
+ QTRY_COMPARE(screen->currentOrientation(), Qt::LandscapeOrientation);
+
+ QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::PortraitOrientation);
+ QTRY_COMPARE(screen->currentOrientation(), Qt::PortraitOrientation);
+}
+
#include <tst_qscreen.moc>
QTEST_MAIN(tst_QScreen);