on xenial help sign in
fix shell tests
commit8d88900d977d4fa4a58c767e68d445e4a4b5b390 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 10 Dec 2015, 22:55 (11 years ago) parentf6aeb81
2 files changed+47−12
qml/Stages/DesktopStage.qml+1−1 tests/qmltests/tst_Shell.qml+46−11
qml/Stages/DesktopStage.qml+1−1
@@ -511,7 +511,7 @@ AbstractStage {
511511 DesktopSpread {
512512 id: spread
513513 objectName: "spread"
514− anchors.fill: parent
514+ anchors.fill: appContainer
515515 workspace: appContainer
516516 focus: state == "altTab"
517517 altTabPressed: root.altTabPressed
tests/qmltests/tst_Shell.qml+46−11
@@ -218,6 +218,19 @@ Rectangle {
218218 }
219219 }
220220
221+ Row {
222+ anchors { left: parent.left; right: parent.right }
223+ CheckBox {
224+ id: autohideLauncherCheckbox
225+ onCheckedChanged: {
226+ GSettingsController.setAutohideLauncher(checked)
227+ }
228+ }
229+ Label {
230+ text: "Autohide launcher"
231+ }
232+ }
233+
221234 Label { text: "Applications"; font.bold: true }
222235
223236 Button {
@@ -1652,7 +1665,7 @@ Rectangle {
16521665 var x = 0;
16531666 var y = shell.height * .5
16541667 mouseMove(shell, x, y)
1655− while (x <= spreadFlickable.width) {
1668+ while (x <= shell.width) {
16561669 x+=10;
16571670 mouseMove(shell, x, y)
16581671 wait(0); // spin the loop so bindings get evaluated
@@ -1726,23 +1739,36 @@ Rectangle {
17261739 keyRelease(Qt.Key_Alt);
17271740 }
17281741
1729− function test_focusAppFromLauncherExitsSpread() {
1730− loadDesktopShellWithApps()
1742+ function test_focusAppFromLauncherExitsSpread_data() {
1743+ return [
1744+ {tag: "autohide launcher", launcherLocked: false },
1745+ {tag: "locked launcher", launcherLocked: true }
1746+ ]
1747+ }
17311748
1732− var desktopSpread = findChild(shell, "spread");
1749+ function test_focusAppFromLauncherExitsSpread(data) {
1750+ loadDesktopShellWithApps()
17331751 var launcher = findChild(shell, "launcher");
1752+ var desktopSpread = findChild(shell, "spread");
17341753 var bfb = findChild(launcher, "buttonShowDashHome");
17351754
1755+ GSettingsController.setAutohideLauncher(!data.launcherLocked);
1756+ waitForRendering(shell);
1757+
17361758 keyPress(Qt.Key_Alt)
17371759 keyClick(Qt.Key_Tab);
17381760
17391761 tryCompare(desktopSpread, "state", "altTab")
17401762
1741− revealLauncherByEdgePushWithMouse();
1742− waitForRendering(shell)
1763+ if (!data.launcherLocked) {
1764+ revealLauncherByEdgePushWithMouse();
1765+ waitForRendering(shell)
1766+ }
17431767
17441768 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1745− tryCompare(launcher, "state", "")
1769+ if (!data.launcherLocked) {
1770+ tryCompare(launcher, "state", "")
1771+ }
17461772 tryCompare(desktopSpread, "state", "")
17471773
17481774 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
@@ -1957,15 +1983,24 @@ Rectangle {
19571983 }
19581984 }
19591985
1960− function test_superTabToCycleLauncher() {
1986+ function test_superTabToCycleLauncher_data() {
1987+ return [
1988+ {tag: "autohide launcher", launcherLocked: false},
1989+ {tag: "locked launcher", launcherLocked: true}
1990+ ]
1991+ }
1992+
1993+ function test_superTabToCycleLauncher(data) {
19611994 loadShell("desktop");
19621995 shell.usageScenario = "desktop";
1996+ GSettingsController.setAutohideLauncher(!data.launcherLocked);
1997+ waitForRendering(shell);
19631998
19641999 var launcher = findChild(shell, "launcher");
19652000 var launcherPanel = findChild(launcher, "launcherPanel");
19662001 var firstAppInLauncher = LauncherModel.get(0).appId;
19672002
1968− compare(launcher.state, "");
2003+ compare(launcher.state, data.launcherLocked ? "visible": "");
19692004 compare(launcherPanel.highlightIndex, -2);
19702005 compare(ApplicationManager.focusedApplicationId, "unity8-dash");
19712006
@@ -1977,7 +2012,7 @@ Rectangle {
19772012 keyClick(Qt.Key_Tab);
19782013 tryCompare(launcherPanel, "highlightIndex", 0);
19792014 keyRelease(Qt.Key_Super_L);
1980− tryCompare(launcher, "state", "");
2015+ tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
19812016 tryCompare(launcherPanel, "highlightIndex", -2);
19822017 tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher);
19832018
@@ -1987,7 +2022,7 @@ Rectangle {
19872022 tryCompare(launcher, "state", "visible");
19882023 tryCompare(launcherPanel, "highlightIndex", -1);
19892024 keyRelease(Qt.Key_Super_L);
1990− tryCompare(launcher, "state", "");
2025+ tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
19912026 tryCompare(launcherPanel, "highlightIndex", -2);
19922027 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
19932028 }