@@ -1857,21 +1857,28 @@ Rectangle {
18571857 loadShell(data.formFactor);
18581858 shell.usageScenario = data.usageScenario;
18591859
1860+ // Add two main stage apps, the second in order to suspend the first.
1861+ // LibreOffice has isTouchApp set to false by our mocks.
18601862 var app1 = ApplicationManager.startApplication("libreoffice");
18611863 waitUntilAppWindowIsFullyLoaded(app1);
1862− var app2 = ApplicationManager.startApplication("dialer-app");
1864+ var app2 = ApplicationManager.startApplication("gallery-app");
18631865 waitUntilAppWindowIsFullyLoaded(app2);
18641866
1865− // Make sure app1 is unfocused but still running
1866− compare(app1.session.lastSurface.activeFocus, false);
1867− compare(app1.isTouchApp, false); // sanity check our mock, which sets this for us
1868− compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
1867+ // Sanity checking
1868+ compare(app1.stage, ApplicationInfoInterface.MainStage);
1869+ compare(app2.stage, ApplicationInfoInterface.MainStage);
1870+ verify(!app1.isTouchApp);
1871+ verify(!app1.session.lastSurface.activeFocus);
1872+
1873+ // Make sure app1 is exempt with a requested suspend
1874+ verify(app1.exemptFromLifecycle);
1875+ compare(app1.requestedState, ApplicationInfoInterface.RequestedSuspended);
18691876 }
18701877
18711878 function test_lifecyclePolicyExemption_data() {
18721879 return [
1873− {tag: "phone", formFactor: "phone", usageScenario: "phone", suspendsApps: true},
1874− {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", suspendsApps: true}
1880+ {tag: "phone", formFactor: "phone", usageScenario: "phone"},
1881+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet"}
18751882 ]
18761883 }
18771884
@@ -1881,14 +1888,20 @@ Rectangle {
18811888
18821889 GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
18831890
1891+ // Add two main stage apps, the second in order to suspend the first
18841892 var app1 = ApplicationManager.startApplication("webbrowser-app");
18851893 waitUntilAppWindowIsFullyLoaded(app1);
1886− var app2 = ApplicationManager.startApplication("dialer-app");
1894+ var app2 = ApplicationManager.startApplication("gallery-app");
18871895 waitUntilAppWindowIsFullyLoaded(app2);
18881896
1889− // Make sure app1 is unfocused but still running
1890− compare(app1.session.lastSurface.activeFocus, false);
1891− compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
1897+ // Sanity checking
1898+ compare(app1.stage, ApplicationInfoInterface.MainStage);
1899+ compare(app2.stage, ApplicationInfoInterface.MainStage);
1900+ verify(!app1.session.lastSurface.activeFocus);
1901+
1902+ // Make sure app1 is exempt with a requested suspend
1903+ verify(app1.exemptFromLifecycle);
1904+ compare(app1.requestedState, ApplicationInfoInterface.RequestedSuspended);
18921905 }
18931906
18941907 function test_switchToStagedForcesLegacyAppClosing_data() {