summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/surface/tst_surface.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:13 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-12 03:05:13 +0100
commit741506eb89a59f960f25706329e7b4d0332c1eb9 (patch)
tree336ae12dcd8ed37f8a789b9ca388c666979a217a /tests/auto/client/surface/tst_surface.cpp
parent1a52c4db428e65f4a0b92bea5811014aaa387263 (diff)
parentacddf1834ffa1b256a38919d9626f1e12460b484 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'tests/auto/client/surface/tst_surface.cpp')
-rw-r--r--tests/auto/client/surface/tst_surface.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/client/surface/tst_surface.cpp b/tests/auto/client/surface/tst_surface.cpp
index 9659235a0..b8a65f159 100644
--- a/tests/auto/client/surface/tst_surface.cpp
+++ b/tests/auto/client/surface/tst_surface.cpp
@@ -45,6 +45,10 @@ private slots:
void waitForFrameCallbackGl();
#endif
void negotiateShmFormat();
+
+ // Subsurfaces
+ void createSubsurface();
+ void createSubsurfaceForHiddenParent();
};
void tst_surface::createDestroySurface()
@@ -160,5 +164,42 @@ void tst_surface::negotiateShmFormat()
});
}
+void tst_surface::createSubsurface()
+{
+ QRasterWindow window;
+ window.resize(64, 64);
+ window.show();
+ QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
+ exec([=] { xdgToplevel()->sendCompleteConfigure(); });
+ QCOMPOSITOR_TRY_VERIFY(xdgSurface()->m_committedConfigureSerial);
+
+ QRasterWindow subWindow;
+ subWindow.setParent(&window);
+ subWindow.resize(64, 64);
+ subWindow.show();
+ 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"