diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-09-02 17:28:05 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-09-02 17:28:16 +0200 |
commit | fba02cc8ae7fb71abb927a06a8e480f7909dc029 (patch) | |
tree | d32e2c1f0070ab49fc85cdc89b744f9925b4e614 /tests/auto/controls/data/tst_scrollindicator.qml | |
parent | f6c3ecdb0646a4d83be5c07dd5369d0b0350260c (diff) | |
parent | 33904b63ce9971efc3763a0048a084ec3324dfc4 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Change-Id: I82da1e547c4ead1181ade19f77c62651c00998a3
Diffstat (limited to 'tests/auto/controls/data/tst_scrollindicator.qml')
-rw-r--r-- | tests/auto/controls/data/tst_scrollindicator.qml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_scrollindicator.qml b/tests/auto/controls/data/tst_scrollindicator.qml index 00730bf4cc..551247f64b 100644 --- a/tests/auto/controls/data/tst_scrollindicator.qml +++ b/tests/auto/controls/data/tst_scrollindicator.qml @@ -157,4 +157,38 @@ TestCase { ignoreWarning(Qt.resolvedUrl("tst_scrollindicator.qml") + ":45:1: QML TestCase: ScrollIndicator must be attached to a Flickable") testCase.ScrollIndicator.vertical = null } + + function test_overshoot() { + var container = flickable.createObject(testCase) + verify(container) + waitForRendering(container) + + var vertical = scrollIndicator.createObject(container, {size: 0.5}) + container.ScrollIndicator.vertical = vertical + + var horizontal = scrollIndicator.createObject(container, {size: 0.5}) + container.ScrollIndicator.horizontal = horizontal + + // negative vertical overshoot (pos < 0) + vertical.position = -0.1 + compare(vertical.contentItem.y, vertical.topPadding) + compare(vertical.contentItem.height, 0.4 * vertical.availableHeight) + + // positive vertical overshoot (pos + size > 1) + vertical.position = 0.8 + compare(vertical.contentItem.y, vertical.topPadding + 0.8 * vertical.availableHeight) + compare(vertical.contentItem.height, 0.2 * vertical.availableHeight) + + // negative horizontal overshoot (pos < 0) + horizontal.position = -0.1 + compare(horizontal.contentItem.x, horizontal.leftPadding) + compare(horizontal.contentItem.width, 0.4 * horizontal.availableWidth) + + // positive horizontal overshoot (pos + size > 1) + horizontal.position = 0.8 + compare(horizontal.contentItem.x, horizontal.leftPadding + 0.8 * horizontal.availableWidth) + compare(horizontal.contentItem.width, 0.2 * horizontal.availableWidth) + + container.destroy() + } } |