on xenial help sign in
Add tests
e530f6bMichael Terry
tests/qmltests/tst_ShellWithPin.qml+58
@@ -155,6 +155,7 @@ Item {
155 AccountsService.enableLauncherWhileLocked = true
155 AccountsService.enableLauncherWhileLocked = true
156 AccountsService.enableIndicatorsWhileLocked = true
156 AccountsService.enableIndicatorsWhileLocked = true
157 AccountsService.demoEdges = false
157 AccountsService.demoEdges = false
158+ callManager.foregroundCall = null
158
159
159 // reload our test subject to get it in a fresh state once again
160 // reload our test subject to get it in a fresh state once again
160 shellLoader.active = true
161 shellLoader.active = true
@@ -207,6 +208,7 @@ Item {
207 tryCompare(lockscreen, "shown", false)
208 tryCompare(lockscreen, "shown", false)
208 tryCompare(greeter, "hasLockedApp", true)
209 tryCompare(greeter, "hasLockedApp", true)
209 tryCompare(greeter, "lockedApp", app)
210 tryCompare(greeter, "lockedApp", app)
211+ tryCompare(LightDM.Greeter, "active", true)
210 tryCompare(ApplicationManager, "focusedApplicationId", app)
212 tryCompare(ApplicationManager, "focusedApplicationId", app)
211 }
213 }
212
214
@@ -381,5 +383,61 @@ Item {
381 callManager.foregroundCall = phoneCall
383 callManager.foregroundCall = phoneCall
382 confirmLockedApp("dialer-app")
384 confirmLockedApp("dialer-app")
383 }
385 }
386+
387+ function test_emergencyDialerActiveCallPanel() {
388+ // Make sure that the following sequence works:
389+ // - Enter emergency mode call
390+ // - Return to greeter
391+ // - Click on active call panel
392+ // - Should be back in emergency mode dialer
393+
394+ var greeter = findChild(shell, "greeter");
395+ var lockscreen = findChild(shell, "lockscreen");
396+
397+ lockscreen.emergencyCall();
398+ confirmLockedApp("dialer-app");
399+ callManager.foregroundCall = phoneCall;
400+
401+ LightDM.Greeter.showGreeter();
402+ tryCompare(lockscreen, "shown", true);
403+ tryCompare(greeter, "hasLockedApp", false);
404+
405+ // simulate a callHint press, the real thing requires dialer: url support
406+ ApplicationManager.requestFocusApplication("dialer-app");
407+
408+ confirmLockedApp("dialer-app");
409+ }
410+
411+ function test_normalDialerActiveCallPanel() {
412+ // Make sure that the following sequence works:
413+ // - Log in
414+ // - Start a call
415+ // - Switch apps
416+ // - Click on active call panel
417+ // - Should be back in normal dialer
418+ // (we've had a bug where we locked screen in this case)
419+
420+ var lockscreen = findChild(shell, "lockscreen");
421+ var panel = findChild(shell, "panel");
422+
423+ enterPin("1234");
424+ tryCompare(lockscreen, "shown", false);
425+ tryCompare(LightDM.Greeter, "active", false);
426+
427+ ApplicationManager.startApplication("dialer-app", ApplicationManager.NoFlag);
428+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
429+ callManager.foregroundCall = phoneCall;
430+
431+ ApplicationManager.requestFocusApplication("unity8-dash");
432+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
433+ tryCompare(panel.callHint, "visible", true);
434+
435+ // simulate a callHint press, the real thing requires dialer: url support
436+ ApplicationManager.requestFocusApplication("dialer-app");
437+
438+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
439+ tryCompare(lockscreen, "shown", false);
440+ tryCompare(LightDM.Greeter, "active", false);
441+ }
384 }
442 }
385}
443}