@@ -1857,21 +1857,28 @@ Rectangle {
1857 loadShell(data.formFactor);
1857 loadShell(data.formFactor);
1858 shell.usageScenario = data.usageScenario;
1858 shell.usageScenario = data.usageScenario;
1860+ // Add two main stage apps, the second in order to suspend the first.
1861+ // LibreOffice has isTouchApp set to false by our mocks.
1860 var app1 = ApplicationManager.startApplication("libreoffice");
1862 var app1 = ApplicationManager.startApplication("libreoffice");
1861 waitUntilAppWindowIsFullyLoaded(app1);
1863 waitUntilAppWindowIsFullyLoaded(app1);
1862− var app2 = ApplicationManager.startApplication("dialer-app");
1864+ var app2 = ApplicationManager.startApplication("gallery-app");
1863 waitUntilAppWindowIsFullyLoaded(app2);
1865 waitUntilAppWindowIsFullyLoaded(app2);
1865− // Make sure app1 is unfocused but still running
1867+ // Sanity checking
1868+ compare(app1.stage, ApplicationInfoInterface.MainStage);
1869+ compare(app2.stage, ApplicationInfoInterface.MainStage);
1870+ verify(!app1.isTouchApp);
1866− compare(app1.session.lastSurface.activeFocus, false);
1871+ verify(!app1.session.lastSurface.activeFocus);
1867− compare(app1.isTouchApp, false); // sanity check our mock, which sets this for us
1872+
1873+ // Make sure app1 is exempt with a requested suspend
1874+ verify(app1.exemptFromLifecycle);
1868− compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
1875+ compare(app1.requestedState, ApplicationInfoInterface.RequestedSuspended);
1871 function test_lifecyclePolicyExemption_data() {
1878 function test_lifecyclePolicyExemption_data() {
1872 return [
1879 return [
1873− {tag: "phone", formFactor: "phone", usageScenario: "phone", suspendsApps: true},
1880+ {tag: "phone", formFactor: "phone", usageScenario: "phone"},
1874− {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", suspendsApps: true}
1881+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet"}
@@ -1881,14 +1888,20 @@ Rectangle {
1882 GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
1889 GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
1891+ // Add two main stage apps, the second in order to suspend the first
1884 var app1 = ApplicationManager.startApplication("webbrowser-app");
1892 var app1 = ApplicationManager.startApplication("webbrowser-app");
1885 waitUntilAppWindowIsFullyLoaded(app1);
1893 waitUntilAppWindowIsFullyLoaded(app1);
1886− var app2 = ApplicationManager.startApplication("dialer-app");
1894+ var app2 = ApplicationManager.startApplication("gallery-app");
1887 waitUntilAppWindowIsFullyLoaded(app2);
1895 waitUntilAppWindowIsFullyLoaded(app2);
1889− // Make sure app1 is unfocused but still running
1897+ // Sanity checking
1898+ compare(app1.stage, ApplicationInfoInterface.MainStage);
1899+ compare(app2.stage, ApplicationInfoInterface.MainStage);
1890− compare(app1.session.lastSurface.activeFocus, false);
1900+ verify(!app1.session.lastSurface.activeFocus);
1902+ // Make sure app1 is exempt with a requested suspend
1903+ verify(app1.exemptFromLifecycle);
1891− compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
1904+ compare(app1.requestedState, ApplicationInfoInterface.RequestedSuspended);
1894 function test_switchToStagedForcesLegacyAppClosing_data() {
1907 function test_switchToStagedForcesLegacyAppClosing_data() {