@@ -1734,20 +1734,39 @@ Rectangle {
17341734 keyRelease(Qt.Key_Control);
17351735 }
17361736
1737− function test_lifecyclePolicy() {
1738− loadShell("desktop");
1737+ function test_lifecyclePolicy_data() {
1738+ return [
1739+ {tag: "phone", formFactor: "phone", usageScenario: "phone", suspendsApps: true},
1740+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", suspendsApps: true},
1741+ {tag: "desktop", formFactor: "tablet", usageScenario: "desktop", suspendsApps: false}
1742+ ]
1743+ }
1744+
1745+ function test_lifecyclePolicy(data) {
1746+ loadShell(data.formFactor);
1747+ shell.usageScenario = data.usageScenario;
17391748
17401749 GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
17411750
17421751 var app1 = ApplicationManager.startApplication("camera-app");
1743− tryCompare(app1, "canSuspend", true);
1744−
1752+ waitUntilAppWindowIsFullyLoaded(app1);
17451753 var app2 = ApplicationManager.startApplication("webbrowser-app");
1746− tryCompare(app2, "canSuspend", false);
1747−
1754+ waitUntilAppWindowIsFullyLoaded(app2);
17481755 var app3 = ApplicationManager.startApplication("libreoffice");
1756+ waitUntilAppWindowIsFullyLoaded(app3);
1757+ var app4 = ApplicationManager.startApplication("dialer-app");
1758+ waitUntilAppWindowIsFullyLoaded(app4);
1759+
1760+ compare(app1.requestedState, data.suspendsApps ?
1761+ ApplicationInfoInterface.RequestedSuspended :
1762+ ApplicationInfoInterface.RequestedRunning);
1763+
1764+ compare(app2.requestedState, ApplicationInfoInterface.RequestedRunning);
1765+
17491766 compare(app3.isTouchApp, false); // sanity check our mock, which sets this for us
1750− tryCompare(app3, "canSuspend", false);
1767+ compare(app3.requestedState, ApplicationInfoInterface.RequestedRunning);
1768+
1769+ compare(app4.requestedState, ApplicationInfoInterface.RequestedRunning);
17511770 }
17521771 }
17531772}