~robertcarr/unity/phablet-integrate-mir-no-sw-cursor

« back to all changes in this revision

Viewing changes to tests/qmltests/Components/tst_Stage.qml

A little tweak to improve the switch application animation.

Approved by PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
199
199
           switch to the next running application. This means (graphically) sliding the
200
200
           next application window from Stage's right edge for a small part of its width */
201
201
        function test_pressingRightEdgeShowsHint() {
202
 
 
203
 
            // it shoulnd't be showing anything at first
204
 
            compare(stage.usingScreenshots, false)
205
 
 
206
202
            redControl.checked = true
207
203
 
208
204
            tryCompare(stage, "usingScreenshots", true) // wait for the animation to start
209
 
            wait(600)
210
205
            tryCompare(stage, "usingScreenshots", false) // and then for it to end
211
206
            compare(fakeAppManager.mainStageFocusedApplication.desktopFile, "red")
212
207
            compare(fakeAppManager.mainStageApplications.get(0).desktopFile, "red")
214
209
            greenControl.checked = true
215
210
 
216
211
            tryCompare(stage, "usingScreenshots", true) // wait for the animation to start
217
 
            wait(600)
218
212
            tryCompare(stage, "usingScreenshots", false) // and then for it to end
219
213
            compare(fakeAppManager.mainStageFocusedApplication.desktopFile, "green")
220
214
            compare(fakeAppManager.mainStageApplications.get(0).desktopFile, "green")
239
233
 
240
234
        function isShowingABitOfNewApp() {
241
235
            // it should come from the right and take less than half of the screen
242
 
            // but at least 15% of it
 
236
            // but at least 5% of it
243
237
            return newAppScreenshot.x > stage.width/2
244
 
                && newAppScreenshot.x < stage.width*(85/100)
 
238
                && newAppScreenshot.x < stage.width*(95/100)
245
239
                && newAppScreenshot.y === 0
246
240
                && newAppScreenshot.visible
247
241
        }
248
242
 
249
243
        function isCurrentAppFadingOut() {
250
244
            // it should get a bit translucent and smaller
251
 
            return oldAppScreenshot.opacity < 0.98
 
245
            return oldAppScreenshot.opacity < 0.99
252
246
                && oldAppScreenshot.opacity >= 0.1
253
 
                && oldAppScreenshot.scale < 0.98
 
247
                && oldAppScreenshot.scale < 0.99
254
248
                && oldAppScreenshot.scale >= 0.1
255
249
                && oldAppScreenshot.visible
256
250
        }
268
262
        /* If you flick from the right edge of the stage leftwards it should cause an
269
263
           application switch.  */
270
264
        function test_dragFromRightEdgeToSwitchApplication() {
271
 
            // it shoulnd't be showing anything at first
272
 
            compare(stage.usingScreenshots, false)
273
 
 
274
265
            redControl.checked = true
275
266
 
276
267
            tryCompare(stage, "usingScreenshots", true) // wait for the animation to start
303
294
           When switching between applications, backgrounds are unnecessary, 'cause the
304
295
           applications are in front of them. */
305
296
        function test_background() {
306
 
            // it shoulnd't be showing anything at first
307
 
            compare(stage.usingScreenshots, false)
308
 
 
309
297
            redControl.checked = true
310
298
            tryCompare(stage, "usingScreenshots", true) // wait for the animation to start
311
299