on xenial help sign in
Fix Shell tests

Approved by: Michael Zanetti

commit2573d23d199d0f9dc147affb2c4cf4a8f5aaf80e authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateThu 18 Jun 2015, 19:40 (11 years ago) parent78173f0847c2c6
1 file changed+14−17
tests/qmltests/tst_Shell.qml+14−17
tests/qmltests/tst_Shell.qml+14−17
@@ -83,7 +83,7 @@ Rectangle {
8383 Shell {
8484 property string shellMode: "full-greeter" /* default */
8585
86− usageScenario: "phone"
86+ usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
8787 orientation: Qt.PortraitOrientation
8888 primaryOrientation: Qt.PortraitOrientation
8989 nativeOrientation: Qt.PortraitOrientation
@@ -151,14 +151,11 @@ Rectangle {
151151 }
152152 }
153153 ListItem.ItemSelector {
154− id: usageModeSelector
154+ id: usageScenarioSelector
155155 anchors { left: parent.left; right: parent.right }
156156 activeFocusOnPress: false
157− text: "Usage mode"
158− model: ["Staged", "Windowed"]
159− onSelectedIndexChanged: {
160− GSettingsController.setUsageMode(model[selectedIndex]);
161− }
157+ text: "Usage scenario"
158+ model: ["phone", "tablet", "desktop"]
162159 }
163160 MouseTouchEmulationCheckbox {
164161 id: mouseEmulation
@@ -725,7 +722,7 @@ Rectangle {
725722
726723 tryCompare(webApp.session.surface, "activeFocus", true);
727724
728− GSettingsController.setUsageMode("Windowed");
725+ shell.usageScenario = "desktop";
729726
730727 // check that the desktop stage and window have been loaded
731728 {
@@ -735,7 +732,7 @@ Rectangle {
735732
736733 tryCompare(webApp.session.surface, "activeFocus", true);
737734
738− GSettingsController.setUsageMode("Staged");
735+ shell.usageScenario = "tablet";
739736
740737 // check that the tablet stage and app surface delegate have been loaded
741738 {
@@ -1205,30 +1202,30 @@ Rectangle {
12051202
12061203 function test_stageLoader_data() {
12071204 return [
1208− {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageMode: "Staged"},
1209− {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageMode: "Staged"},
1210− {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageMode: "Windowed"}
1205+ {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageScenario: "phone"},
1206+ {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageScenario: "tablet"},
1207+ {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageScenario: "desktop"}
12111208 ]
12121209 }
12131210
12141211 function test_stageLoader(data) {
1215− GSettingsController.setUsageMode(data.usageMode);
12161212 loadShell(data.formFactor);
1213+ shell.usageScenario = data.usageScenario;
12171214 var stageLoader = findChild(shell, "applicationsDisplayLoader");
12181215 verify(String(stageLoader.source).indexOf(data.source) >= 0);
12191216 }
12201217
12211218 function test_launcherInverted_data() {
12221219 return [
1223− {tag: "phone", formFactor: "phone", usageMode: "Staged", launcherInverted: true},
1224− {tag: "tablet", formFactor: "tablet", usageMode: "Staged", launcherInverted: true},
1225− {tag: "desktop", formFactor: "tablet", usageMode: "Windowed", launcherInverted: false}
1220+ {tag: "phone", formFactor: "phone", usageScenario: "phone", launcherInverted: true},
1221+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", launcherInverted: true},
1222+ {tag: "desktop", formFactor: "tablet", usageScenario: "desktop", launcherInverted: false}
12261223 ]
12271224 }
12281225
12291226 function test_launcherInverted(data) {
1230− GSettingsController.setUsageMode(data.usageMode);
12311227 loadShell(data.formFactor);
1228+ shell.usageScenario = data.usageScenario;
12321229
12331230 var launcher = findChild(shell, "launcher");
12341231 compare(launcher.inverted, data.launcherInverted);