2 * Copyright 2013 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19import "../../../qml/Components"
23 name: "AnimationControllerWithSignals"
25 property real someNumber: 0.0
28 id: someNumberAnimation
30 properties: "someNumber"
36 id: testSubjectComponent
37 AnimationControllerWithSignals {}
49 function test_completeToEndWithSignal() {
50 loader.sourceComponent = testSubjectComponent;
51 var testSubject = loader.item;
53 testSubject.animation = someNumberAnimation;
54 testSubject.progress = 0;
56 signalSpy.signalName = "animationCompletedAtEnd";
57 signalSpy.target = testSubject;
60 compare(testSubject.completing, false)
61 compare(testSubject.completed, true)
63 testSubject.completeToEndWithSignal();
64 compare(testSubject.completing, true)
65 compare(testSubject.completed, true)
66 compare(signalSpy.count, 0);
68 testSubject.progress = 0.5;
69 compare(testSubject.completing, true)
70 compare(testSubject.completed, false)
71 compare(signalSpy.count, 0);
73 testSubject.progress = 1.0;
74 compare(testSubject.completing, false)
75 compare(testSubject.completed, true)
76 compare(signalSpy.count, 1);
78 testSubject.animation = null
79 loader.sourceComponent = undefined;
82 function test_completeToBeginningWithSignal() {
83 loader.sourceComponent = testSubjectComponent;
84 var testSubject = loader.item;
86 testSubject.animation = someNumberAnimation;
87 testSubject.progress = 1;
89 signalSpy.signalName = "animationCompletedAtBeginning";
90 signalSpy.target = testSubject;
93 compare(testSubject.completing, false)
94 compare(testSubject.completed, true)
96 testSubject.completeToBeginningWithSignal();
97 compare(testSubject.completing, true)
98 compare(testSubject.completed, true)
99 compare(signalSpy.count, 0);
101 testSubject.progress = 0.5;
102 compare(testSubject.completing, true)
103 compare(testSubject.completed, false)
104 compare(signalSpy.count, 0);
106 testSubject.progress = 0;
107 compare(testSubject.completing, false)
108 compare(testSubject.completed, true)
109 compare(signalSpy.count, 1);
111 testSubject.animation = null
112 loader.sourceComponent = undefined;
115 function test_settingProgressWithoutCallingCompleteWithSignal() {
116 loader.sourceComponent = testSubjectComponent;
117 var testSubject = loader.item;
119 testSubject.animation = someNumberAnimation;
120 testSubject.progress = 0;
122 signalSpy.signalName = "animationCompletedAtEnd";
123 signalSpy.target = testSubject;
126 compare(testSubject.completing, false)
127 compare(testSubject.completed, true)
129 testSubject.progress = 0.5;
130 compare(testSubject.completing, false)
131 compare(testSubject.completed, false)
132 compare(signalSpy.count, 0);
134 testSubject.progress = 1;
135 compare(testSubject.completing, false)
136 compare(testSubject.completed, true)
137 compare(signalSpy.count, 0);
139 testSubject.animation = null
140 loader.sourceComponent = undefined;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list