summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/compositor/tst_compositor.cpp
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@liri.io>2019-04-06 20:00:40 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@liri.io>2019-08-16 10:13:03 +0200
commite0115d9ccdbb541033b9ebc43c11fb4943becaff (patch)
treeb2bf6ec00724f87ac38edbb6925a9887ce710264 /tests/auto/compositor/compositor/tst_compositor.cpp
parented79c14c48501cb9d2ed922da78843f06ba208f0 (diff)
Compositor: Test output available geometry
Increase coverage by implementing a test for the available geometry. Change-Id: Idaba38043dadea69d7494ff9caa944e224e4c228 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'tests/auto/compositor/compositor/tst_compositor.cpp')
-rw-r--r--tests/auto/compositor/compositor/tst_compositor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp
index 66792621..da5acc27 100644
--- a/tests/auto/compositor/compositor/tst_compositor.cpp
+++ b/tests/auto/compositor/compositor/tst_compositor.cpp
@@ -73,6 +73,7 @@ private slots:
void singleClient();
void multipleClients();
void geometry();
+ void availableGeometry();
void modes();
void comparingModes();
void sizeFollowsWindow();
@@ -367,6 +368,22 @@ void tst_WaylandCompositor::geometry()
QTRY_COMPARE(client.refreshRate, 60000);
}
+void tst_WaylandCompositor::availableGeometry()
+{
+ TestCompositor compositor;
+ compositor.create();
+
+ QWaylandOutputMode mode(QSize(1024, 768), 60000);
+ compositor.defaultOutput()->addMode(mode, true);
+ compositor.defaultOutput()->setCurrentMode(mode);
+
+ MockClient client;
+
+ QRect availableGeometry(50, 100, 850, 600);
+ compositor.defaultOutput()->setAvailableGeometry(availableGeometry);
+ QCOMPARE(compositor.defaultOutput()->availableGeometry(), availableGeometry);
+}
+
void tst_WaylandCompositor::modes()
{
TestCompositor compositor;