@@ -2154,8 +2154,10 @@ Rectangle {
2155 function test_switchToStagedForcesLegacyAppClosing_data() {
2155 function test_switchToStagedForcesLegacyAppClosing_data() {
2156 return [
2156 return [
2157− {tag: "forceClose", replug: false },
2157+ {tag: "forceClose", replug: false, tabletMode: false, screenSize: Qt.size(units.gu(20), units.gu(40)) },
2158+ {tag: "replug", replug: true, tabletMode: false, screenSize: Qt.size(units.gu(20), units.gu(40)) },
2159+ {tag: "forceClose+tablet", replug: false, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) },
2158− {tag: "replug", replug: true }
2160+ {tag: "replug+tablet", replug: true, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) }
@@ -2164,6 +2166,11 @@ Rectangle {
2164 shell.usageScenario = "desktop"
2166 shell.usageScenario = "desktop"
2165 waitForRendering(shell);
2167 waitForRendering(shell);
2169+ // setup some screen size
2170+ var dialogs = findChild(root, "dialogs");
2172+ dialogs.screenSize = data.screenSize;
2167 ApplicationManager.startApplication("camera-app")
2174 ApplicationManager.startApplication("camera-app")
2169 shell.usageScenario = "phone"
2176 shell.usageScenario = "phone"
@@ -2182,14 +2189,13 @@ Rectangle {
2182 shell.usageScenario = "phone"
2189 shell.usageScenario = "phone"
2183 waitForRendering(shell);
2190 waitForRendering(shell);
2185− // The popup must appear now
2192+ // The popup must appear now, unless in "tablet" mode
2186 popup = findChild(root, "modeSwitchWarningDialog");
2193 popup = findChild(root, "modeSwitchWarningDialog");
2187− compare(popup !== null, true);
2194+ compare(popup !== null, !data.tabletMode);
2189− if (data.replug) {
2196+ if (data.replug || data.tabletMode) {
2190 shell.usageScenario = "desktop"
2197 shell.usageScenario = "desktop"
2191 waitForRendering(shell);
2198 waitForRendering(shell);
2193 } else {
2199 } else {
2194 var forceCloseButton = findChild(popup, "forceCloseButton");
2200 var forceCloseButton = findChild(popup, "forceCloseButton");
2195 mouseClick(forceCloseButton, forceCloseButton.width / 2, forceCloseButton.height / 2);
2201 mouseClick(forceCloseButton, forceCloseButton.width / 2, forceCloseButton.height / 2);
@@ -2200,7 +2206,7 @@ Rectangle {
2200 popup = findChild(root, "modeSwitchWarningDialog");
2206 popup = findChild(root, "modeSwitchWarningDialog");
2201 tryCompareFunction(function() { return popup === null}, true);
2207 tryCompareFunction(function() { return popup === null}, true);
2203− if (data.replug) {
2209+ if (data.replug || data.tabletMode) {
2204 // Libreoffice must still be running
2210 // Libreoffice must still be running
2205 compare(ApplicationManager.findApplication("libreoffice") !== null, true);
2211 compare(ApplicationManager.findApplication("libreoffice") !== null, true);
2206 } else {
2212 } else {