diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-11-01 10:16:43 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-11-04 13:41:11 +0000 |
commit | 09474cdf5244ce6fba51a6b01bfe50caf7635c66 (patch) | |
tree | fb8ade366a276667a1eddeb8bc4f1d16662cc6ab | |
parent | 962b9be7992cef672cb6307af5653c97382c334f (diff) | |
download | qtwayland-09474cdf5244ce6fba51a6b01bfe50caf7635c66.tar.gz |
Add client test for subsurface with hidden parent
Task-number: QTBUG-79674
Change-Id: I451ee4423dee511f41070498a61167912920c086
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r-- | tests/auto/client/surface/tst_surface.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/client/surface/tst_surface.cpp b/tests/auto/client/surface/tst_surface.cpp index 451fbac7..f9dcec58 100644 --- a/tests/auto/client/surface/tst_surface.cpp +++ b/tests/auto/client/surface/tst_surface.cpp @@ -42,7 +42,9 @@ private slots: void waitForFrameCallbackGl(); void negotiateShmFormat(); + // Subsurfaces void createSubsurface(); + void createSubsurfaceForHiddenParent(); }; void tst_surface::createDestroySurface() @@ -172,5 +174,26 @@ void tst_surface::createSubsurface() QCOMPOSITOR_TRY_VERIFY(subSurface()); } +// Used to cause a crash in libwayland (QTBUG-79674) +void tst_surface::createSubsurfaceForHiddenParent() +{ + QRasterWindow window; + window.resize(64, 64); + window.show(); + QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); + exec([=] { xdgToplevel()->sendCompleteConfigure(); }); + QCOMPOSITOR_TRY_VERIFY(xdgSurface()->m_committedConfigureSerial); + + window.hide(); + + QRasterWindow subWindow; + subWindow.setParent(&window); + subWindow.resize(64, 64); + subWindow.show(); + + // Make sure the client doesn't quit before it has a chance to crash + xdgPingAndWaitForPong(); +} + QCOMPOSITOR_TEST_MAIN(tst_surface) #include "tst_surface.moc" |