@@ -1734,20 +1734,39 @@ Rectangle {
1734 keyRelease(Qt.Key_Control);
1734 keyRelease(Qt.Key_Control);
1737+ function test_lifecyclePolicy_data() {
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}
1737− function test_lifecyclePolicy() {
1745+ function test_lifecyclePolicy(data) {
1738− loadShell("desktop");
1746+ loadShell(data.formFactor);
1747+ shell.usageScenario = data.usageScenario;
1740 GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
1749 GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
1742 var app1 = ApplicationManager.startApplication("camera-app");
1751 var app1 = ApplicationManager.startApplication("camera-app");
1743− tryCompare(app1, "canSuspend", true);
1752+ waitUntilAppWindowIsFullyLoaded(app1);
1745 var app2 = ApplicationManager.startApplication("webbrowser-app");
1753 var app2 = ApplicationManager.startApplication("webbrowser-app");
1746− tryCompare(app2, "canSuspend", false);
1754+ waitUntilAppWindowIsFullyLoaded(app2);
1748 var app3 = ApplicationManager.startApplication("libreoffice");
1755 var app3 = ApplicationManager.startApplication("libreoffice");
1756+ waitUntilAppWindowIsFullyLoaded(app3);
1757+ var app4 = ApplicationManager.startApplication("dialer-app");
1758+ waitUntilAppWindowIsFullyLoaded(app4);
1760+ compare(app1.requestedState, data.suspendsApps ?
1761+ ApplicationInfoInterface.RequestedSuspended :
1762+ ApplicationInfoInterface.RequestedRunning);
1764+ compare(app2.requestedState, ApplicationInfoInterface.RequestedRunning);
1749 compare(app3.isTouchApp, false); // sanity check our mock, which sets this for us
1766 compare(app3.isTouchApp, false); // sanity check our mock, which sets this for us
1750− tryCompare(app3, "canSuspend", false);
1767+ compare(app3.requestedState, ApplicationInfoInterface.RequestedRunning);
1769+ compare(app4.requestedState, ApplicationInfoInterface.RequestedRunning);