on xenial help sign in
fix tests
commitbdd08ca991ee547e4ea884450ed6b73803fcc36d authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 19 Mar 2014, 19:07 (13 years ago) parentd889c31
2 files changed+16−14
qml/Stages/PhoneStage.qml+3−1 tests/qmltests/Stages/tst_PhoneStage.qml+13−13
qml/Stages/PhoneStage.qml+3−1
@@ -170,7 +170,7 @@ Item {
170170 // Mir signals us that the newly started app has gotten focus before it paints something on the screen
171171 // This would result in the old app surface becoming visible for a bit.
172172 // FIXME: change appManager to only change the focusedApplicationId when the surface is ready to be shown.
173− interval: 1500
173+ interval: 0// 1500
174174 repeat: false
175175 onTriggered: {
176176 priv.applicationStarting = false;
@@ -279,6 +279,8 @@ Item {
279279
280280 onDraggingChanged: {
281281 if (dragging) {
282+ // Gesture recognized. Start recording this gesture
283+ gesturePoints = [];
282284 return;
283285 }
284286
tests/qmltests/Stages/tst_PhoneStage.qml+13−13
@@ -108,14 +108,14 @@ Item {
108108
109109 function test_enterSpread_data() {
110110 return [
111− {tag: "<position1 (linear movement)", positionMarker: "positionMarker1", linear: true, offset: -1, endStage: 0, targetStage: 0, newFocusedIndex: 1 },
112− {tag: "<position1 (non-linear movement)", positionMarker: "positionMarker1", linear: false, offset: -1, endStage: 0, targetStage: 0, newFocusedIndex: 0 },
113− {tag: ">position1", positionMarker: "positionMarker1", linear: true, offset: +1, endStage: 0, targetStage: 0, newFocusedIndex: 1 },
114− {tag: "<position2 (linear)", positionMarker: "positionMarker2", linear: true, offset: -1, endStage: 0, targetStage: 0, newFocusedIndex: 1 },
115− {tag: "<position2 (non-linear)", positionMarker: "positionMarker2", linear: false, offset: -1, endStage: 0, targetStage: 0, newFocusedIndex: 1 },
116− {tag: ">position2", positionMarker: "positionMarker2", linear: true, offset: +1, endStage: 1, targetStage: 0, newFocusedIndex: 1 },
117− {tag: "<position3", positionMarker: "positionMarker3", linear: true, offset: -1, endStage: 1, targetStage: 0, newFocusedIndex: 1 },
118− {tag: ">position3", positionMarker: "positionMarker3", linear: true, offset: +1, endStage: 2, targetStage: 2, newFocusedIndex: 2 },
111+ {tag: "<position1 (linear movement)", positionMarker: "positionMarker1", linear: true, offset: -1, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
112+ {tag: "<position1 (non-linear movement)", positionMarker: "positionMarker1", linear: false, offset: -1, endPhase: 0, targetPhase: 0, newFocusedIndex: 0 },
113+ {tag: ">position1", positionMarker: "positionMarker1", linear: true, offset: +1, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
114+ {tag: "<position2 (linear)", positionMarker: "positionMarker2", linear: true, offset: -1, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
115+ {tag: "<position2 (non-linear)", positionMarker: "positionMarker2", linear: false, offset: -1, endPhase: 0, targetPhase: 0, newFocusedIndex: 1 },
116+ {tag: ">position2", positionMarker: "positionMarker2", linear: true, offset: +1, endPhase: 1, targetPhase: 0, newFocusedIndex: 1 },
117+ {tag: "<position3", positionMarker: "positionMarker3", linear: true, offset: -1, endPhase: 1, targetPhase: 0, newFocusedIndex: 1 },
118+ {tag: ">position3", positionMarker: "positionMarker3", linear: true, offset: +1, endPhase: 2, targetPhase: 2, newFocusedIndex: 2 },
119119 ];
120120 }
121121
@@ -135,7 +135,7 @@ Item {
135135 touchFlick(phoneStage, startX, startY, endX, endY,
136136 true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
137137
138− tryCompare(spreadView, "stage", data.endStage)
138+ tryCompare(spreadView, "phase", data.endPhase)
139139
140140 if (!data.linear) {
141141 touchFlick(phoneStage, endX, endY, endX + units.gu(.5), endY,
@@ -146,9 +146,9 @@ Item {
146146
147147 touchRelease(phoneStage, endX, endY);
148148
149− tryCompare(spreadView, "stage", data.targetStage)
149+ tryCompare(spreadView, "phase", data.targetPhase)
150150
151− if (data.targetStage == 2) {
151+ if (data.targetPhase == 2) {
152152 var app2 = findChild(spreadView, "appDelegate2");
153153 mouseClick(app2, units.gu(1), units.gu(1));
154154 }
@@ -183,7 +183,7 @@ Item {
183183 touchFlick(phoneStage, startX, startY, endX, endY,
184184 true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
185185
186− tryCompare(spreadView, "stage", 2);
186+ tryCompare(spreadView, "phase", 2);
187187
188188 var tile = findChild(spreadView, "appDelegate" + data.index);
189189 var appId = ApplicationManager.get(data.index).appId;
@@ -199,7 +199,7 @@ Item {
199199 console.log("clicking app", data.index, "(", appId, ")")
200200 mouseClick(spreadView, tile.mapToItem(spreadView).x + units.gu(1), spreadView.height / 2)
201201 tryCompare(ApplicationManager, "focusedApplicationId", appId);
202− tryCompare(spreadView, "stage", 0);
202+ tryCompare(spreadView, "phase", 0);
203203 }
204204
205205 function test_animateAppStartup() {