summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/compositor/tst_compositor.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-08-28 12:58:55 +0200
committerJohan Helsing <johan.helsing@qt.io>2017-10-25 11:37:38 +0000
commit063299d8520ca5c944a596723e63e7654e712955 (patch)
treec8d609fee9fbdfb83f3792082214322a646997ca /tests/auto/compositor/compositor/tst_compositor.cpp
parenta89d294a2e15995a707316608e6df0efc31b1857 (diff)
qtwaylandscanner: Remove globals when destroying wrappers
When globals are destroyed on the compositor side, send the "global_remove" event and set the resource implementation to nullptr so all further requests are ignored. This also adds a compositor test to see if outputs are removed when they are deleted. Change-Id: Ib77a4c3d4c2c93283a14ac20f5964e2ce08a1d38 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@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 c54903dc..39ae1d48 100644
--- a/tests/auto/compositor/compositor/tst_compositor.cpp
+++ b/tests/auto/compositor/compositor/tst_compositor.cpp
@@ -64,6 +64,7 @@ private slots:
void sizeFollowsWindow();
void mapSurface();
void frameCallback();
+ void removeOutput();
void advertisesXdgShellSupport();
void createsXdgSurfaces();
@@ -375,6 +376,22 @@ void tst_WaylandCompositor::frameCallback()
wl_surface_destroy(surface);
}
+void tst_WaylandCompositor::removeOutput()
+{
+ TestCompositor compositor;
+ QWindow window;
+ window.resize(800, 600);
+ auto output = new QWaylandOutput(&compositor, &window);
+
+ compositor.create();
+ MockClient client;
+ QTRY_COMPARE(client.m_outputs.size(), 2);
+
+ delete output;
+ compositor.flushClients();
+ QTRY_COMPARE(client.m_outputs.size(), 1);
+}
+
void tst_WaylandCompositor::seatCapabilities()
{
TestCompositor compositor;