fvogt added a comment.
Yes, a unit test makes sense. I tried to add // replace the data source with itself, ensure that it did not get cancelled // replace the data source with itself, ensure that it did not get cancelled selectionOfferedSpy.clear(); dataSource2->offer(QStringLiteral("text/plain")); dataDevice->setSelection(2, dataSource2.data()); QVERIFY(selectionOfferedSpy.wait()); QVERIFY(sourceCancelled2Spy.isEmpty()); in TestDataDevice::testReplaceSource() and it fails without this patch. With this patch however, the selection isn't offered (is that correct behaviour?) so the wait() times out. Is there a better way to test this? REPOSITORY R127 KWayland REVISION DETAIL https://phabricator.kde.org/D13535 To: fvogt, #plasma, #frameworks Cc: graesslin, kde-frameworks-devel, michaelh, ngraham, bruns