on xenial help sign in
Fix Shell tests
847c2c6Daniel d'Andrada
tests/qmltests/tst_Shell.qml+14−17
@@ -83,7 +83,7 @@ Rectangle {
83 Shell {
83 Shell {
84 property string shellMode: "full-greeter" /* default */
84 property string shellMode: "full-greeter" /* default */
85
85
86− usageScenario: "phone"
86+ usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
87 orientation: Qt.PortraitOrientation
87 orientation: Qt.PortraitOrientation
88 primaryOrientation: Qt.PortraitOrientation
88 primaryOrientation: Qt.PortraitOrientation
89 nativeOrientation: Qt.PortraitOrientation
89 nativeOrientation: Qt.PortraitOrientation
@@ -151,14 +151,11 @@ Rectangle {
151 }
151 }
152 }
152 }
153 ListItem.ItemSelector {
153 ListItem.ItemSelector {
154− id: usageModeSelector
154+ id: usageScenarioSelector
155 anchors { left: parent.left; right: parent.right }
155 anchors { left: parent.left; right: parent.right }
156 activeFocusOnPress: false
156 activeFocusOnPress: false
157− text: "Usage mode"
157+ text: "Usage scenario"
158− model: ["Staged", "Windowed"]
158+ model: ["phone", "tablet", "desktop"]
159− onSelectedIndexChanged: {
160− GSettingsController.setUsageMode(model[selectedIndex]);
161− }
162 }
159 }
163 MouseTouchEmulationCheckbox {
160 MouseTouchEmulationCheckbox {
164 id: mouseEmulation
161 id: mouseEmulation
@@ -725,7 +722,7 @@ Rectangle {
725
722
726 tryCompare(webApp.session.surface, "activeFocus", true);
723 tryCompare(webApp.session.surface, "activeFocus", true);
727
724
728− GSettingsController.setUsageMode("Windowed");
725+ shell.usageScenario = "desktop";
729
726
730 // check that the desktop stage and window have been loaded
727 // check that the desktop stage and window have been loaded
731 {
728 {
@@ -735,7 +732,7 @@ Rectangle {
735
732
736 tryCompare(webApp.session.surface, "activeFocus", true);
733 tryCompare(webApp.session.surface, "activeFocus", true);
737
734
738− GSettingsController.setUsageMode("Staged");
735+ shell.usageScenario = "tablet";
739
736
740 // check that the tablet stage and app surface delegate have been loaded
737 // check that the tablet stage and app surface delegate have been loaded
741 {
738 {
@@ -1205,30 +1202,30 @@ Rectangle {
1205
1202
1206 function test_stageLoader_data() {
1203 function test_stageLoader_data() {
1207 return [
1204 return [
1208− {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageMode: "Staged"},
1205+ {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageScenario: "phone"},
1209− {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageMode: "Staged"},
1206+ {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageScenario: "tablet"},
1210− {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageMode: "Windowed"}
1207+ {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageScenario: "desktop"}
1211 ]
1208 ]
1212 }
1209 }
1213
1210
1214 function test_stageLoader(data) {
1211 function test_stageLoader(data) {
1215− GSettingsController.setUsageMode(data.usageMode);
1216 loadShell(data.formFactor);
1212 loadShell(data.formFactor);
1213+ shell.usageScenario = data.usageScenario;
1217 var stageLoader = findChild(shell, "applicationsDisplayLoader");
1214 var stageLoader = findChild(shell, "applicationsDisplayLoader");
1218 verify(String(stageLoader.source).indexOf(data.source) >= 0);
1215 verify(String(stageLoader.source).indexOf(data.source) >= 0);
1219 }
1216 }
1220
1217
1221 function test_launcherInverted_data() {
1218 function test_launcherInverted_data() {
1222 return [
1219 return [
1223− {tag: "phone", formFactor: "phone", usageMode: "Staged", launcherInverted: true},
1220+ {tag: "phone", formFactor: "phone", usageScenario: "phone", launcherInverted: true},
1224− {tag: "tablet", formFactor: "tablet", usageMode: "Staged", launcherInverted: true},
1221+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", launcherInverted: true},
1225− {tag: "desktop", formFactor: "tablet", usageMode: "Windowed", launcherInverted: false}
1222+ {tag: "desktop", formFactor: "tablet", usageScenario: "desktop", launcherInverted: false}
1226 ]
1223 ]
1227 }
1224 }
1228
1225
1229 function test_launcherInverted(data) {
1226 function test_launcherInverted(data) {
1230− GSettingsController.setUsageMode(data.usageMode);
1231 loadShell(data.formFactor);
1227 loadShell(data.formFactor);
1228+ shell.usageScenario = data.usageScenario;
1232
1229
1233 var launcher = findChild(shell, "launcher");
1230 var launcher = findChild(shell, "launcher");
1234 compare(launcher.inverted, data.launcherInverted);
1231 compare(launcher.inverted, data.launcherInverted);