aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/stability/tst_unloadrepeater.qml
blob: d446d916dba5e4f163346876c2feb5c3694e1efd (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (C) 2016 Jolla Ltd, author: <gunnar.sletta@jollamobile.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick 2.2
import QtTest 1.1

Item {
    width : 800
    height : 600

    Timer {
        id: probablyOkNow
        interval: 2000
        running: true
        repeat: false
        onTriggered: testCase.when = true;
    }

    TestCase {
        id: testCase
        name: "unloaded-repeater"
        when: false
        function test_endresult()
        {
            havocTimer.running = false;
            verify(true, "If we didn't crash by now, all is good")
        }
    }

    Timer {
        id: havocTimer
        interval: 1
        running: true
        repeat: true

        onTriggered: {
            loader.sourceComponent =  null
            loader.sourceComponent = component1
        }

    }

    Loader {
        id : loader
        asynchronous : true
    }

    Component {
        id : component1
        Grid {
            columns: 70
            spacing: 2

            Repeater {
                model : 2000

                Rectangle {
                    width : 3
                    height : 3
                    color : "blue"
                }
            }
        }
    }
}