From 1b109dbd917e7e4627177f375f17e60257486520 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 6 Apr 2018 12:50:02 +0200 Subject: tst_QClipboard: Skip on Wayland, as it requires real input events On Wayland, manipulating the clipboard requires an input event serial, which is not possible to get unless the compositor sends us input events. Change-Id: If5231a5db85f8d6ad988ea93f240cee0c3466f9f Reviewed-by: Friedemann Kleint --- tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 87fd5c0dc6..993ebbaac6 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -41,10 +41,8 @@ class tst_QClipboard : public QObject { Q_OBJECT private slots: -#ifdef QT_NO_CLIPBOARD void initTestCase(); - void cleanupTestCase(); -#else +#if QT_CONFIG(clipboard) void init(); #if defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(Q_OS_QNX) void copy_exit_paste(); @@ -58,19 +56,16 @@ private slots: #endif }; -#ifdef QT_NO_CLIPBOARD void tst_QClipboard::initTestCase() { +#if !QT_CONFIG(clipboard) QSKIP("This test requires clipboard support"); +#endif + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: Manipulating the clipboard requires real input events. Can't auto test."); } -void tst_QClipboard::cleanupTestCase() -{ - QSKIP("This test requires clipboard support"); -} - -#else - +#if QT_CONFIG(clipboard) void tst_QClipboard::init() { #if QT_CONFIG(process) @@ -436,7 +431,7 @@ void tst_QClipboard::clearBeforeSetText() QCOMPARE(QGuiApplication::clipboard()->text(), text); } -#endif +#endif // QT_CONFIG(clipboard) QTEST_MAIN(tst_QClipboard) -- cgit v1.2.3