on xenial help sign in
fix shell tests
8d88900Michael Zanetti
qml/Stages/DesktopStage.qml+1−1
@@ -511,7 +511,7 @@ AbstractStage {
511 DesktopSpread {
511 DesktopSpread {
512 id: spread
512 id: spread
513 objectName: "spread"
513 objectName: "spread"
514− anchors.fill: parent
514+ anchors.fill: appContainer
515 workspace: appContainer
515 workspace: appContainer
516 focus: state == "altTab"
516 focus: state == "altTab"
517 altTabPressed: root.altTabPressed
517 altTabPressed: root.altTabPressed
tests/qmltests/tst_Shell.qml+46−11
@@ -218,6 +218,19 @@ Rectangle {
218 }
218 }
219 }
219 }
220
220
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+
221 Label { text: "Applications"; font.bold: true }
234 Label { text: "Applications"; font.bold: true }
222
235
223 Button {
236 Button {
@@ -1652,7 +1665,7 @@ Rectangle {
1652 var x = 0;
1665 var x = 0;
1653 var y = shell.height * .5
1666 var y = shell.height * .5
1654 mouseMove(shell, x, y)
1667 mouseMove(shell, x, y)
1655− while (x <= spreadFlickable.width) {
1668+ while (x <= shell.width) {
1656 x+=10;
1669 x+=10;
1657 mouseMove(shell, x, y)
1670 mouseMove(shell, x, y)
1658 wait(0); // spin the loop so bindings get evaluated
1671 wait(0); // spin the loop so bindings get evaluated
@@ -1726,23 +1739,36 @@ Rectangle {
1726 keyRelease(Qt.Key_Alt);
1739 keyRelease(Qt.Key_Alt);
1727 }
1740 }
1728
1741
1729− function test_focusAppFromLauncherExitsSpread() {
1742+ function test_focusAppFromLauncherExitsSpread_data() {
1730− loadDesktopShellWithApps()
1743+ return [
1744+ {tag: "autohide launcher", launcherLocked: false },
1745+ {tag: "locked launcher", launcherLocked: true }
1746+ ]
1747+ }
1731
1748
1732− var desktopSpread = findChild(shell, "spread");
1749+ function test_focusAppFromLauncherExitsSpread(data) {
1750+ loadDesktopShellWithApps()
1733 var launcher = findChild(shell, "launcher");
1751 var launcher = findChild(shell, "launcher");
1752+ var desktopSpread = findChild(shell, "spread");
1734 var bfb = findChild(launcher, "buttonShowDashHome");
1753 var bfb = findChild(launcher, "buttonShowDashHome");
1735
1754
1755+ GSettingsController.setAutohideLauncher(!data.launcherLocked);
1756+ waitForRendering(shell);
1757+
1736 keyPress(Qt.Key_Alt)
1758 keyPress(Qt.Key_Alt)
1737 keyClick(Qt.Key_Tab);
1759 keyClick(Qt.Key_Tab);
1738
1760
1739 tryCompare(desktopSpread, "state", "altTab")
1761 tryCompare(desktopSpread, "state", "altTab")
1740
1762
1763+ if (!data.launcherLocked) {
1741− revealLauncherByEdgePushWithMouse();
1764+ revealLauncherByEdgePushWithMouse();
1742− waitForRendering(shell)
1765+ waitForRendering(shell)
1766+ }
1743
1767
1744 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1768 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1769+ if (!data.launcherLocked) {
1745− tryCompare(launcher, "state", "")
1770+ tryCompare(launcher, "state", "")
1771+ }
1746 tryCompare(desktopSpread, "state", "")
1772 tryCompare(desktopSpread, "state", "")
1747
1773
1748 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
1774 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
@@ -1957,15 +1983,24 @@ Rectangle {
1957 }
1983 }
1958 }
1984 }
1959
1985
1986+ function test_superTabToCycleLauncher_data() {
1987+ return [
1988+ {tag: "autohide launcher", launcherLocked: false},
1989+ {tag: "locked launcher", launcherLocked: true}
1990+ ]
1991+ }
1992+
1960− function test_superTabToCycleLauncher() {
1993+ function test_superTabToCycleLauncher(data) {
1961 loadShell("desktop");
1994 loadShell("desktop");
1962 shell.usageScenario = "desktop";
1995 shell.usageScenario = "desktop";
1996+ GSettingsController.setAutohideLauncher(!data.launcherLocked);
1997+ waitForRendering(shell);
1963
1998
1964 var launcher = findChild(shell, "launcher");
1999 var launcher = findChild(shell, "launcher");
1965 var launcherPanel = findChild(launcher, "launcherPanel");
2000 var launcherPanel = findChild(launcher, "launcherPanel");
1966 var firstAppInLauncher = LauncherModel.get(0).appId;
2001 var firstAppInLauncher = LauncherModel.get(0).appId;
1967
2002
1968− compare(launcher.state, "");
2003+ compare(launcher.state, data.launcherLocked ? "visible": "");
1969 compare(launcherPanel.highlightIndex, -2);
2004 compare(launcherPanel.highlightIndex, -2);
1970 compare(ApplicationManager.focusedApplicationId, "unity8-dash");
2005 compare(ApplicationManager.focusedApplicationId, "unity8-dash");
1971
2006
@@ -1977,7 +2012,7 @@ Rectangle {
1977 keyClick(Qt.Key_Tab);
2012 keyClick(Qt.Key_Tab);
1978 tryCompare(launcherPanel, "highlightIndex", 0);
2013 tryCompare(launcherPanel, "highlightIndex", 0);
1979 keyRelease(Qt.Key_Super_L);
2014 keyRelease(Qt.Key_Super_L);
1980− tryCompare(launcher, "state", "");
2015+ tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
1981 tryCompare(launcherPanel, "highlightIndex", -2);
2016 tryCompare(launcherPanel, "highlightIndex", -2);
1982 tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher);
2017 tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher);
1983
2018
@@ -1987,7 +2022,7 @@ Rectangle {
1987 tryCompare(launcher, "state", "visible");
2022 tryCompare(launcher, "state", "visible");
1988 tryCompare(launcherPanel, "highlightIndex", -1);
2023 tryCompare(launcherPanel, "highlightIndex", -1);
1989 keyRelease(Qt.Key_Super_L);
2024 keyRelease(Qt.Key_Super_L);
1990− tryCompare(launcher, "state", "");
2025+ tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
1991 tryCompare(launcherPanel, "highlightIndex", -2);
2026 tryCompare(launcherPanel, "highlightIndex", -2);
1992 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
2027 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
1993 }
2028 }