diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-02-08 10:47:01 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-02-08 10:47:27 +0000 |
commit | 7d5fbbeda315ec37b142d9688b1a8a7c403f0475 (patch) | |
tree | ebe7b2e289d0301a45e162627ac0c40c75c58d80 /tests/auto/quick/qquicktextinput | |
parent | 51673f868a9ab576d9f5e02effb2681308ea82e4 (diff) |
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 <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktextinput')
-rw-r--r-- | tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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++; } |