~unity-team/unity8/trunk

« back to all changes in this revision

Viewing changes to tests/qmltests/Notifications/tst_Notifications.qml

  • Committer: Bileto Bot
  • Author(s): Lukáš Tinkl
  • Date: 2016-08-11 06:24:31 UTC
  • mfrom: (2494.1.9 fixDismissedSIMPinDialog)
  • Revision ID: ci-train-bot@canonical.com-20160811062431-993wm6lwdms30qkh
Fix incorrect SIM PIN dialog position when entering a wrong PIN (LP: #1596076)

Approved by: Josh Arenson, Michael Zanetti

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2015 Canonical Ltd.
 
2
 * Copyright 2015-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU Lesser General Public License as published by
31
31
    height: notificationsRect.height
32
32
    property int index: 0
33
33
 
34
 
    // add the default/PlaceHolder notification to the model
35
 
    Component.onCompleted: {
36
 
        var component = Qt.createComponent("Notification.qml")
37
 
        var n = component.createObject("notification", {"nid": index++,
38
 
                                                        "type": Notification.PlaceHolder,
39
 
                                                        "hints": {},
40
 
                                                        "summary": "",
41
 
                                                        "body": "",
42
 
                                                        "icon": "",
43
 
                                                        "secondaryIcon": "",
44
 
                                                        "rawActions": []})
45
 
        n.completed.connect(mockModel.onCompleted)
46
 
        mockModel.append(n)
47
 
    }
48
 
 
49
34
    Row {
50
35
        id: rootRow
51
36
 
157
142
        }
158
143
 
159
144
        function clearNotifications() {
160
 
            while(mockModel.count > 1) {
161
 
                remove1stNotification()
 
145
            while(mockModel.count > 0) {
 
146
                remove1stNotification();
162
147
            }
163
148
        }
164
149
 
165
150
        function remove1stNotification() {
166
 
            if (mockModel.count > 1) {
167
 
                mockModel.removeSecond()
168
 
            }
 
151
            mockModel.removeFirst();
169
152
        }
170
153
 
171
154
        Rectangle {
791
774
                waitForRendering(notifications);
792
775
 
793
776
                // first one should be expanded by default
794
 
                var notification1 = findChild(notifications, "notification1") // 0 is placeholder...
 
777
                var notification1 = findChild(notifications, "notification0")
795
778
                verify(!!notification1, "notification wasn't found");
796
779
                waitForRendering(notification1);
797
780
                verify(notification1.expanded);
798
781
 
799
782
                // click the 2nd one, verify it's now expanded
800
 
                var notification2 = findChild(notifications, "notification2") // 0 is placeholder...
 
783
                var notification2 = findChild(notifications, "notification1")
801
784
                verify(!!notification2, "notification wasn't found");
802
785
                waitForRendering(notification2);
803
786
                mouseClick(notification2);