on xenial help sign in
Add test and comment for the relied-upon behavior of emitting a focus id changed signal even when we focus the same app
e6fa1b8Michael Terry
qml/Shell.qml+2
@@ -213,6 +213,8 @@ Item {
213 Connections {
213 Connections {
214 target: ApplicationManager
214 target: ApplicationManager
215
215
216+ // This signal is also fired when we try to focus the current app
217+ // again. We rely on this!
216 onFocusedApplicationIdChanged: {
218 onFocusedApplicationIdChanged: {
217 var appId = ApplicationManager.focusedApplicationId;
219 var appId = ApplicationManager.focusedApplicationId;
218
220
tests/qmltests/tst_ShellWithPin.qml+22
@@ -462,6 +462,28 @@ Item {
462 tryCompare(LightDM.Greeter, "active", false);
462 tryCompare(LightDM.Greeter, "active", false);
463 }
463 }
464
464
465+ function test_focusRequestedHidesCoverPage() {
466+ LightDM.Greeter.showGreeter();
467+
468+ var app = ApplicationManager.startApplication("gallery-app");
469+ // wait until the app is fully loaded (ie, real surface replaces splash screen)
470+ tryCompareFunction(function() { return app.session !== null && app.session.surface !== null }, true);
471+
472+ // New app hides coverPage?
473+ var greeter = findChild(shell, "greeter");
474+ var coverPage = testCase.findChild(shell, "coverPage");
475+ tryCompare(coverPage, "showProgress", 0);
476+ tryCompare(greeter, "fullyShown", true);
477+
478+ LightDM.Greeter.showGreeter();
479+ tryCompare(coverPage, "showProgress", 1);
480+
481+ // Make sure focusing same app triggers same behavior
482+ ApplicationManager.requestFocusApplication("gallery-app");
483+ tryCompare(coverPage, "showProgress", 0);
484+ tryCompare(greeter, "fullyShown", true);
485+ }
486+
465 function test_suspend() {
487 function test_suspend() {
466 var greeter = findChild(shell, "greeter");
488 var greeter = findChild(shell, "greeter");
467
489