diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-11-22 14:51:05 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-11-22 15:00:11 +0000 |
commit | 261e84c3e333574b300ea0b09f87fccc88c4a0ea (patch) | |
tree | c27a0822ea8838ede93357412af4492de9e72ad9 | |
parent | 08ba34d6a8cf7e7ab21ce51ca6aa7d812d035a67 (diff) |
Use tryVerify() instead of wait() where possible
This may help with the flaky tst_tooltip test, and makes
tst_tumbler a little bit cleaner.
Task-number: QTBUG-57258
Change-Id: Ida987fb9d60392aba4142e4711131aded56d425d
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r-- | tests/auto/controls/data/tst_tooltip.qml | 3 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_tumbler.qml | 8 |
2 files changed, 2 insertions, 9 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml index d9c95dbf..51601d66 100644 --- a/tests/auto/controls/data/tst_tooltip.qml +++ b/tests/auto/controls/data/tst_tooltip.qml @@ -240,8 +240,7 @@ TestCase { else control.visible = false verify(control.exit.running) - wait(100) // TODO: replace with tryVerify() in 5.8 - verify(control.opacity < 1) + tryVerify(function() { return control.opacity < 1; }) if (data.imperative) control.open() diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml index b3230ca4..01d5cdee 100644 --- a/tests/auto/controls/data/tst_tumbler.qml +++ b/tests/auto/controls/data/tst_tumbler.qml @@ -83,16 +83,10 @@ TestCase { } function cleanup() { - var destroyed = false; - cleanupItem.Component.destruction.connect(function() { destroyed = true; }); - cleanupItem.destroy(); - // Waiting until it's deleted before continuing makes debugging // test failures much easier, because there aren't unrelated items hanging around. - // TODO: Replace with tryVerify(!tumbler) in 5.8. - while (!destroyed) - wait(0) + tryVerify(function() { return !tumbler; }); } function createTumbler(args) { |