1741
1764
verify(y < 4000);
1743
keyRelease(Qt.Key_Control);
1746
function test_focusAppFromLauncherExitsSpread() {
1766
keyRelease(Qt.Key_Alt);
1769
function test_focusAppFromLauncherExitsSpread_data() {
1771
{tag: "autohide launcher", launcherLocked: false },
1772
{tag: "locked launcher", launcherLocked: true }
1776
function test_focusAppFromLauncherExitsSpread(data) {
1747
1777
loadDesktopShellWithApps()
1778
var launcher = findChild(shell, "launcher");
1749
1779
var desktopSpread = findChild(shell, "spread");
1750
var launcher = findChild(shell, "launcher");
1751
1780
var bfb = findChild(launcher, "buttonShowDashHome");
1753
keyPress(Qt.Key_Control)
1782
GSettingsController.setAutohideLauncher(!data.launcherLocked);
1783
waitForRendering(shell);
1785
keyPress(Qt.Key_Alt)
1754
1786
keyClick(Qt.Key_Tab);
1756
1788
tryCompare(desktopSpread, "state", "altTab")
1758
revealLauncherByEdgePushWithMouse();
1759
tryCompare(launcher, "x", 0);
1760
mouseMove(bfb, bfb.width / 2, bfb.height / 2)
1761
waitForRendering(shell)
1790
if (!data.launcherLocked) {
1791
revealLauncherByEdgePushWithMouse();
1792
tryCompare(launcher, "x", 0);
1793
mouseMove(bfb, bfb.width / 2, bfb.height / 2)
1794
waitForRendering(shell)
1763
1797
mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1764
tryCompare(launcher, "state", "")
1798
if (!data.launcherLocked) {
1799
tryCompare(launcher, "state", "")
1765
1801
tryCompare(desktopSpread, "state", "")
1767
1803
tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
1769
keyRelease(Qt.Key_Control);
1805
keyRelease(Qt.Key_Alt);
1772
1808
// regression test for http://pad.lv/1443319
2028
function test_superTabToCycleLauncher_data() {
2030
{tag: "autohide launcher", launcherLocked: false},
2031
{tag: "locked launcher", launcherLocked: true}
2035
function test_superTabToCycleLauncher(data) {
2036
loadShell("desktop");
2037
shell.usageScenario = "desktop";
2038
GSettingsController.setAutohideLauncher(!data.launcherLocked);
2039
waitForRendering(shell);
2041
var launcher = findChild(shell, "launcher");
2042
var launcherPanel = findChild(launcher, "launcherPanel");
2043
var firstAppInLauncher = LauncherModel.get(0).appId;
2045
compare(launcher.state, data.launcherLocked ? "visible": "");
2046
compare(launcherPanel.highlightIndex, -2);
2047
compare(ApplicationManager.focusedApplicationId, "unity8-dash");
2049
// Use Super + Tab Tab to cycle to the first entry in the launcher
2050
keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2051
keyClick(Qt.Key_Tab);
2052
tryCompare(launcher, "state", "visible");
2053
tryCompare(launcherPanel, "highlightIndex", -1);
2054
keyClick(Qt.Key_Tab);
2055
tryCompare(launcherPanel, "highlightIndex", 0);
2056
keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2057
tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2058
tryCompare(launcherPanel, "highlightIndex", -2);
2059
tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher);
2061
// Now go back to the dash
2062
keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2063
keyClick(Qt.Key_Tab);
2064
tryCompare(launcher, "state", "visible");
2065
tryCompare(launcherPanel, "highlightIndex", -1);
2066
keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2067
tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2068
tryCompare(launcherPanel, "highlightIndex", -2);
2069
tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
2072
function test_longpressSuperOpensLauncher() {
2073
loadShell("desktop");
2074
var launcher = findChild(shell, "launcher");
2075
var shortcutHint = findChild(findChild(launcher, "launcherDelegate0"), "shortcutHint")
2077
compare(launcher.state, "");
2078
keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2079
tryCompare(launcher, "state", "visible");
2080
tryCompare(shortcutHint, "visible", true);
2082
keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2083
tryCompare(launcher, "state", "");
2084
tryCompare(shortcutHint, "visible", false);
2087
function test_metaNumberLaunchesFromLauncher_data() {
2089
{tag: "Meta+1", key: Qt.Key_1, index: 0},
2090
{tag: "Meta+2", key: Qt.Key_2, index: 1},
2091
{tag: "Meta+4", key: Qt.Key_5, index: 4},
2092
{tag: "Meta+0", key: Qt.Key_0, index: 9},
2096
function test_metaNumberLaunchesFromLauncher(data) {
2097
loadShell("desktop");
2098
var launcher = findChild(shell, "launcher");
2099
var appId = LauncherModel.get(data.index).appId;
2100
waitForRendering(shell);
2102
keyClick(data.key, Qt.MetaModifier);
2103
tryCompare(ApplicationManager, "focusedApplicationId", appId);
2106
function test_altF1OpensLauncherForKeyboardNavigation() {
2107
loadShell("desktop");
2108
waitForRendering(shell);
2109
var launcher = findChild(shell, "launcher");
2111
keyClick(Qt.Key_F1, Qt.AltModifier);
2112
tryCompare(launcher, "state", "visible");
2113
tryCompare(launcher, "focus", true)
2116
function test_lockedOutLauncherAddsMarginsToMaximized() {
2117
loadShell("desktop");
2118
shell.usageScenario = "desktop";
2119
waitForRendering(shell);
2120
var appContainer = findChild(shell, "appContainer");
2121
var launcher = findChild(shell, "launcher");
2123
var app = ApplicationManager.startApplication("music-app");
2124
waitUntilAppWindowIsFullyLoaded(app);
2125
var appDelegate = findChild(appContainer, "appDelegate_music-app");
2126
appDelegate.maximize();
2127
tryCompare(appDelegate, "visuallyMaximized", true);
2128
waitForRendering(shell);
2130
GSettingsController.setAutohideLauncher(true);
2131
waitForRendering(shell)
2132
var hiddenSize = appDelegate.width;
2134
GSettingsController.setAutohideLauncher(false);
2135
waitForRendering(shell)
2136
var shownSize = appDelegate.width;
2138
compare(shownSize + launcher.panelWidth, hiddenSize);
2141
function test_fullscreenAppHidesLockedOutLauncher() {
2142
loadShell("desktop");
2143
shell.usageScenario = "desktop";
2145
var launcher = findChild(shell, "launcher");
2146
var launcherPanel = findChild(launcher, "launcherPanel");
2148
GSettingsController.setAutohideLauncher(false);
2149
waitForRendering(shell)
2151
tryCompare(launcher, "lockedVisible", true);
2153
var cameraApp = ApplicationManager.startApplication("camera-app");
2154
waitUntilAppWindowIsFullyLoaded(cameraApp);
2156
tryCompare(launcher, "lockedVisible", false);
1992
2160
function test_inputEventsOnEdgesEndUpInAppSurface_data() {
1994
2162
{ tag: "phone", repeaterName: "spreadRepeater" },