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
commite6fa1b8e13b64ab1d44b7c87aab99a9def6baf73 authorMichael Terry <michael.terry@canonical.com> dateThu 12 Feb 2015, 08:58 (12 years ago) parentca39b8b
2 files changed+24
qml/Shell.qml+2 tests/qmltests/tst_ShellWithPin.qml+22
qml/Shell.qml+2
@@ -213,6 +213,8 @@ Item {
213213 Connections {
214214 target: ApplicationManager
215215
216+ // This signal is also fired when we try to focus the current app
217+ // again. We rely on this!
216218 onFocusedApplicationIdChanged: {
217219 var appId = ApplicationManager.focusedApplicationId;
218220
tests/qmltests/tst_ShellWithPin.qml+22
@@ -462,6 +462,28 @@ Item {
462462 tryCompare(LightDM.Greeter, "active", false);
463463 }
464464
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+
465487 function test_suspend() {
466488 var greeter = findChild(shell, "greeter");
467489