summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/compositor/tst_compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/compositor/compositor/tst_compositor.cpp')
-rw-r--r--tests/auto/compositor/compositor/tst_compositor.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp
index 0e11618a..6c4aa107 100644
--- a/tests/auto/compositor/compositor/tst_compositor.cpp
+++ b/tests/auto/compositor/compositor/tst_compositor.cpp
@@ -79,7 +79,7 @@ private slots:
void mapSurface();
void mapSurfaceHiDpi();
void frameCallback();
- void removeOutput();
+ void outputs();
void customSurface();
void advertisesXdgShellSupport();
@@ -622,18 +622,33 @@ void tst_WaylandCompositor::frameCallback()
wl_surface_destroy(surface);
}
-void tst_WaylandCompositor::removeOutput()
+void tst_WaylandCompositor::outputs()
{
TestCompositor compositor;
+
+ QSignalSpy defaultOutputSpy(&compositor, SIGNAL(defaultOutputChanged()));
+
+ compositor.create();
+
+ QSignalSpy outputAddedSpy(&compositor, SIGNAL(outputAdded(QWaylandOutput*)));
+ QSignalSpy outputRemovedSpy(&compositor, SIGNAL(outputRemoved(QWaylandOutput*)));
+
QWindow window;
window.resize(800, 600);
+
auto output = new QWaylandOutput(&compositor, &window);
+ QTRY_COMPARE(outputAddedSpy.count(), 1);
+
+ compositor.setDefaultOutput(output);
+ QTRY_COMPARE(defaultOutputSpy.count(), 2);
- compositor.create();
MockClient client;
QTRY_COMPARE(client.m_outputs.size(), 2);
delete output;
+ QTRY_COMPARE(outputRemovedSpy.count(), 1);
+ QEXPECT_FAIL("", "FIXME: defaultOutputChanged() is not emitted when the default output is removed", Continue);
+ QTRY_COMPARE(defaultOutputSpy.count(), 3);
compositor.flushClients();
QTRY_COMPARE(client.m_outputs.size(), 1);
}