aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
blob: bad8a1c0ba9d6a53aafe9dbd3e369f354fd5b471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.0
import QtTest 1.1

Item {
    Rectangle {
        id: rect

        property bool finished: false

        Behavior on opacity {
            NumberAnimation {
                onRunningChanged: {
                    if (!running) {
                        if (rect.opacity <= 0.1)
                            rect.opacity = 1
                        else
                            rect.finished = true
                    }
                }
            }
        }
    }

    TestCase {
        name: "AbstractAnitaionJobCrash"

        function test_noCrash() {
            rect.opacity = 0
            while (!rect.finished)
                wait(100)
        }
    }
}