From 7d5fbbeda315ec37b142d9688b1a8a7c403f0475 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 8 Feb 2018 10:47:01 +0100 Subject: Stabilize test In some cases on X11, the clipboard wouldn't be empty even though we just cleared it. The reason seems to be that it's then owned by a different process. So simply check whether we own the selection before checking that it's empty. This should avoid the random failures we've been seeing in this test. Change-Id: Id069eda5a24ad29e932aeb6a28275c20b010f90c Reviewed-by: Simon Hausmann Reviewed-by: Shawn Rutledge --- tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/quick/qquicktextinput') diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 9b526f80c5..39a8909617 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -2677,7 +2677,7 @@ void tst_qquicktextinput::copyAndPaste() QCOMPARE(clipboard->text(), QString("My password")); clipboard->clear(); } else { - QVERIFY(clipboard->text().isEmpty()); + QVERIFY(!clipboard->ownsSelection() || clipboard->text().isEmpty()); } index++; } @@ -2745,7 +2745,7 @@ void tst_qquicktextinput::copyAndPasteKeySequence() QCOMPARE(clipboard->text(), QString("My password")); clipboard->clear(); } else { - QVERIFY(clipboard->text().isEmpty()); + QVERIFY(!clipboard->ownsClipboard() || clipboard->text().isEmpty()); } index++; } -- cgit v1.2.3