summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-20 11:38:52 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-20 11:38:52 +0200
commit20ebb685e0fef048e56ed19403575634ce4b3435 (patch)
tree6ad6fedfbe4d361e40a0307f1f0cdc39044b53b6 /tests
parente1f89e15cf00420bd77ac16a867a1cadc9b942fc (diff)
parent3cb09edd71745edda4bbe8de3a6d7ad8e4ea5f58 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/client/client/tst_client.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 0c9c007a2..8acddfbe7 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -142,6 +142,7 @@ private slots:
void backingStore();
void touchDrag();
void mouseDrag();
+ void dontCrashOnMultipleCommits();
private:
MockCompositor *compositor;
@@ -333,6 +334,32 @@ void tst_WaylandClient::mouseDrag()
QTRY_VERIFY(window.dragStarted);
}
+void tst_WaylandClient::dontCrashOnMultipleCommits()
+{
+ auto window = new TestWindow();
+ window->show();
+
+ QRect rect(QPoint(), window->size());
+
+ QBackingStore backingStore(window);
+ backingStore.resize(rect.size());
+ backingStore.beginPaint(rect);
+ QPainter p(backingStore.paintDevice());
+ p.fillRect(rect, Qt::magenta);
+ p.end();
+ backingStore.endPaint();
+
+ backingStore.flush(rect);
+ backingStore.flush(rect);
+ backingStore.flush(rect);
+
+ compositor->processWaylandEvents();
+
+ delete window;
+
+ QTRY_VERIFY(!compositor->surface());
+}
+
int main(int argc, char **argv)
{
setenv("XDG_RUNTIME_DIR", ".", 1);