diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-24 07:55:38 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-04-24 07:29:37 +0000 |
commit | 1691662e66e5651c2995a07f9159a4395fe67373 (patch) | |
tree | e45149fae92677f7611c0bf81fe3d40183969d5c /tests/auto/controls | |
parent | 49423c18f5fa7f26b1a02a79055a05b67f322a6a (diff) |
tst_slider & tst_dial: add simple tests for null handles
Just to ensure that these corner cases are also tested. We should not
assume that the handle visuals exist, so these tests must not crash.
Change-Id: I3dbf6ec78667bd9e99b3de79ffa8109858f9edd5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r-- | tests/auto/controls/data/tst_dial.qml | 13 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_slider.qml | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml index 3955e60d..33b0dbea 100644 --- a/tests/auto/controls/data/tst_dial.qml +++ b/tests/auto/controls/data/tst_dial.qml @@ -579,4 +579,17 @@ TestCase { compare(control.value, 2.5) compare(control.position, 0.25) } + + function test_nullHandle() { + var control = createTemporaryObject(dialComponent, testCase) + verify(control) + + control.handle = null + + mousePress(control) + verify(control.pressed, true) + + mouseRelease(control) + compare(control.pressed, false) + } } diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index 127bdea6..8d696297 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -782,4 +782,17 @@ TestCase { compare(control.valueAt(0.5), data.values[2]) compare(control.valueAt(1.0), data.values[3]) } + + function test_nullHandle() { + var control = createTemporaryObject(slider, testCase) + verify(control) + + control.handle = null + + mousePress(control) + verify(control.pressed, true) + + mouseRelease(control) + compare(control.pressed, false) + } } |