[autotests] Extend TestDataDevice for unbound check in createDataOffer

Extends the test case for checking that the nullptr check is taken
when trying to send a selection on an already unbound DataDevice.
This commit is contained in:
Martin Gräßlin 2016-06-15 09:33:10 +02:00
parent e2d46c574c
commit 2417faff4d

View file

@ -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()