diff --git a/src/wayland/autotests/client/test_datadevice.cpp b/src/wayland/autotests/client/test_datadevice.cpp index e9971b1f33..0fef6f96f9 100644 --- a/src/wayland/autotests/client/test_datadevice.cpp +++ b/src/wayland/autotests/client/test_datadevice.cpp @@ -380,6 +380,17 @@ void TestDataDevice::testSetSelection() QCOMPARE(selectionChangedSpy.count(), 1); QCOMPARE(selectionClearedSpy.count(), 1); QVERIFY(!deviceInterface->selection()); + + // set another selection + dataDevice->setSelection(2, dataSource.data()); + QVERIFY(selectionChangedSpy.wait()); + // now unbind the dataDevice + QSignalSpy unboundSpy(deviceInterface, &DataDeviceInterface::unbound); + QVERIFY(unboundSpy.isValid()); + dataDevice.reset(); + QVERIFY(unboundSpy.wait()); + // send a selection to the unbound data device + deviceInterface->sendSelection(deviceInterface); } void TestDataDevice::testSendSelectionOnSeat()