@@ -195,51 +195,6 @@ Rectangle {
195 name: "Stage"
195 name: "Stage"
196 when: windowShown
196 when: windowShown
198− /* If you press Stage's right edge it should show the hint that it's possible to
199− switch to the next running application. This means (graphically) sliding the
200− next application window from Stage's right edge for a small part of its width */
201− function test_pressingRightEdgeShowsHint() {
202− redControl.checked = true
204− tryCompare(stage, "usingScreenshots", true) // wait for the animation to start
205− tryCompare(stage, "usingScreenshots", false) // and then for it to end
206− compare(fakeAppManager.mainStageFocusedApplication.desktopFile, "red")
207− compare(fakeAppManager.mainStageApplications.get(0).desktopFile, "red")
209− greenControl.checked = true
211− tryCompare(stage, "usingScreenshots", true) // wait for the animation to start
212− tryCompare(stage, "usingScreenshots", false) // and then for it to end
213− compare(fakeAppManager.mainStageFocusedApplication.desktopFile, "green")
214− compare(fakeAppManager.mainStageApplications.get(0).desktopFile, "green")
216− var draggingAreaCenterX = stage.width - (stage.rightEdgeDraggingAreaWidth / 2)
217− var draggingAreaCenterY = stage.height / 2
218− touchPress(stage, draggingAreaCenterX, draggingAreaCenterY)
220− // wait for the animation to start
221− tryCompare(stage, "usingScreenshots", true)
223− // "red" should be the new/next application being shown
224− compare(newAppScreenshot.application.desktopFile, "red")
225− tryCompareFunction(isShowingABitOfNewApp, true);
227− // "green" should be the current application being shown
228− compare(oldAppScreenshot.application.desktopFile, "green")
229− tryCompareFunction(isCurrentAppFadingOut, true);
231− touchRelease(stage, draggingAreaCenterX, draggingAreaCenterY)
234− function isShowingABitOfNewApp() {
235− // it should come from the right and take less than half of the screen
236− // but at least 5% of it
237− return newAppScreenshot.x > stage.width/2
238− && newAppScreenshot.x < stage.width*(95/100)
239− && newAppScreenshot.y === 0
240− && newAppScreenshot.visible
243 function isCurrentAppFadingOut() {
198 function isCurrentAppFadingOut() {
244 // it should get a bit translucent and smaller
199 // it should get a bit translucent and smaller
245 return oldAppScreenshot.opacity < 0.99
200 return oldAppScreenshot.opacity < 0.99
@@ -307,15 +262,17 @@ Rectangle {
308 var draggingAreaCenterX = stage.width - (stage.rightEdgeDraggingAreaWidth / 2)
263 var draggingAreaCenterX = stage.width - (stage.rightEdgeDraggingAreaWidth / 2)
309 var draggingAreaCenterY = stage.height / 2
264 var draggingAreaCenterY = stage.height / 2
265+ var finalTouchX = draggingAreaCenterX - units.gu(5)
310− touchPress(stage, draggingAreaCenterX, draggingAreaCenterY)
266+ touchFlick(stage, draggingAreaCenterX, draggingAreaCenterY,
267+ finalTouchX, draggingAreaCenterY,
268+ true /* beginTouch */, false /* endTouch */)
312 // wait for the animation to start
270 // wait for the animation to start
313 tryCompare(stage, "usingScreenshots", true)
271 tryCompare(stage, "usingScreenshots", true)
315 compare(newAppScreenshot.withBackground, false, "switched app does have background enabled")
273 compare(newAppScreenshot.withBackground, false, "switched app does have background enabled")
317− tryCompareFunction(isShowingABitOfNewApp, true); // wait for the hint animation to finish
318− touchRelease(stage, draggingAreaCenterX, draggingAreaCenterY)
275+ touchRelease(stage, finalTouchX, draggingAreaCenterY)