Android: expect QPlainTextEdit::canPaste() to fail after clipboard clear

Android 9 introduce an API call to clear the clipboard, before that
it wasn't possible to do that, the test QPlainTextEdit::canPaste()
should expect that to fail.

Pick-to: 6.3 6.2
Task-number: QTBUG-100470
Change-Id: Ie2d8aabf77672c62b3a6c72a080a4e37f1696303
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
Assam Boudjelthia 2022-03-14 15:04:33 +02:00
parent 6696134644
commit a818885a3d

View File

@ -1028,6 +1028,10 @@ void tst_QPlainTextEdit::copyAvailable()
#endif
ed->clear();
QApplication::clipboard()->clear();
#ifdef Q_OS_ANDROID
if (QNativeInterface::QAndroidApplication::sdkVersion() < 28)
QEXPECT_FAIL("", "Before Android 9, there's no API to clear the clipboard ", Continue);
#endif
QVERIFY(!ed->canPaste());
QSignalSpy spyCopyAvailabe(ed, SIGNAL(copyAvailable(bool)));