@@ -589,6 +589,38 @@ Rectangle {
589 compare(ApplicationManager.get(0).appId, "unity8-dash");
589 compare(ApplicationManager.get(0).appId, "unity8-dash");
592+ function test_phoneLeftEdgeDrag_data() {
594+ {tag: "without launcher",
595+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
596+ launcherHides: true, greeterShown: false},
598+ {tag: "with launcher",
599+ revealLauncher: true, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
600+ launcherHides: true, greeterShown: false},
602+ {tag: "small swipe",
603+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
604+ launcherHides: false, greeterShown: false},
607+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
608+ launcherHides: true, greeterShown: false},
610+ {tag: "small swipe with greeter",
611+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
612+ launcherHides: false, greeterShown: true},
614+ {tag: "long swipe with greeter",
615+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
616+ launcherHides: true, greeterShown: true},
618+ {tag: "swipe over dash",
619+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "unity8-dash",
620+ launcherHides: false, greeterShown: false},
592 function test_snapDecisionDismissalReturnsFocus() {
624 function test_snapDecisionDismissalReturnsFocus() {
593 loadShell("phone");
625 loadShell("phone");
594 swipeAwayGreeter();
626 swipeAwayGreeter();
@@ -653,38 +685,6 @@ Rectangle {
653 mockNotificationsModel.append(n)
685 mockNotificationsModel.append(n)
656− function test_phoneLeftEdgeDrag_data() {
658− {tag: "without launcher",
659− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
660− launcherHides: true, greeterShown: false},
662− {tag: "with launcher",
663− revealLauncher: true, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
664− launcherHides: true, greeterShown: false},
666− {tag: "small swipe",
667− revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
668− launcherHides: false, greeterShown: false},
671− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
672− launcherHides: true, greeterShown: false},
674− {tag: "small swipe with greeter",
675− revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
676− launcherHides: false, greeterShown: true},
678− {tag: "long swipe with greeter",
679− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
680− launcherHides: true, greeterShown: true},
682− {tag: "swipe over dash",
683− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "unity8-dash",
684− launcherHides: false, greeterShown: false},
688 function test_phoneLeftEdgeDrag(data) {
688 function test_phoneLeftEdgeDrag(data) {
689 loadShell("phone");
689 loadShell("phone");
690 swipeAwayGreeter();
690 swipeAwayGreeter();
@@ -1357,7 +1357,7 @@ Rectangle {
1357 function test_tapOnRightEdgeReachesApplicationSurface() {
1357 function test_tapOnRightEdgeReachesApplicationSurface() {
1358 loadShell("phone");
1358 loadShell("phone");
1359 swipeAwayGreeter();
1359 swipeAwayGreeter();
1360− var topmostSpreadDelegate = findChild(shell, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
1360+ var topmostSpreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
1361 verify(topmostSpreadDelegate);
1361 verify(topmostSpreadDelegate);
1363 waitUntilFocusedApplicationIsShowingItsSurface();
1363 waitUntilFocusedApplicationIsShowingItsSurface();
@@ -1365,7 +1365,7 @@ Rectangle {
1365 var topmostSurfaceItem = findChild(topmostSpreadDelegate, "surfaceItem");
1365 var topmostSurfaceItem = findChild(topmostSpreadDelegate, "surfaceItem");
1366 verify(topmostSurfaceItem);
1366 verify(topmostSurfaceItem);
1368− var rightEdgeDragArea = findChild(shell, "spreadDragArea");
1368+ var rightEdgeDragArea = findChild(shell, "rightEdgeDragArea");
1369 topmostSurfaceItem.touchPressCount = 0;
1369 topmostSurfaceItem.touchPressCount = 0;
1370 topmostSurfaceItem.touchReleaseCount = 0;
1370 topmostSurfaceItem.touchReleaseCount = 0;
@@ -1386,9 +1386,9 @@ Rectangle {
1386 function test_rightEdgeDragDoesNotReachApplicationSurface() {
1386 function test_rightEdgeDragDoesNotReachApplicationSurface() {
1387 loadShell("phone");
1387 loadShell("phone");
1388 swipeAwayGreeter();
1388 swipeAwayGreeter();
1389− var topmostSpreadDelegate = findChild(shell, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
1389+ var topmostSpreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
1390 var topmostSurfaceItem = findChild(topmostSpreadDelegate, "surfaceItem");
1390 var topmostSurfaceItem = findChild(topmostSpreadDelegate, "surfaceItem");
1391− var rightEdgeDragArea = findChild(shell, "spreadDragArea");
1391+ var rightEdgeDragArea = findChild(shell, "rightEdgeDragArea");
1393 topmostSurfaceItem.touchPressCount = 0;
1393 topmostSurfaceItem.touchPressCount = 0;
1394 topmostSurfaceItem.touchReleaseCount = 0;
1394 topmostSurfaceItem.touchReleaseCount = 0;
@@ -1406,7 +1406,7 @@ Rectangle {
1407 function waitUntilFocusedApplicationIsShowingItsSurface()
1407 function waitUntilFocusedApplicationIsShowingItsSurface()
1409− var spreadDelegate = findChild(shell, "spreadDelegate_" + topLevelSurfaceList.idAt(0));
1409+ var spreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
1410 var appState = findInvisibleChild(spreadDelegate, "applicationWindowStateGroup");
1410 var appState = findInvisibleChild(spreadDelegate, "applicationWindowStateGroup");
1411 tryCompare(appState, "state", "surface");
1411 tryCompare(appState, "state", "surface");
1412 var transitions = appState.transitions;
1412 var transitions = appState.transitions;
@@ -1425,8 +1425,7 @@ Rectangle {
1426 // check if it's indeed showing the spread
1426 // check if it's indeed showing the spread
1427 var stage = findChild(shell, "stage");
1427 var stage = findChild(shell, "stage");
1428− var spreadView = findChild(stage, "spreadView");
1428+ tryCompare(stage, "state", "spread");
1429− tryCompare(spreadView, "phase", 2);
1432 function test_tapUbuntuIconInLauncherOverAppSpread() {
1431 function test_tapUbuntuIconInLauncherOverAppSpread() {
@@ -1462,8 +1461,7 @@ Rectangle {
1462 // check that the stage has left spread mode.
1461 // check that the stage has left spread mode.
1464 var stage = findChild(shell, "stage");
1463 var stage = findChild(shell, "stage");
1465− var spreadView = findChild(stage, "spreadView");
1464+ tryCompare(stage, "state", "staged");
1466− tryCompare(spreadView, "phase", 0);
1469 // check that the launcher got dismissed
1467 // check that the launcher got dismissed
@@ -1530,21 +1528,6 @@ Rectangle {
1533− function test_stageLoader_data() {
1535− {tag: "phone", source: "Stages/PhoneStage.qml", formFactor: "phone", usageScenario: "phone"},
1536− {tag: "tablet", source: "Stages/TabletStage.qml", formFactor: "tablet", usageScenario: "tablet"},
1537− {tag: "desktop", source: "Stages/DesktopStage.qml", formFactor: "tablet", usageScenario: "desktop"}
1541− function test_stageLoader(data) {
1542− loadShell(data.formFactor);
1543− shell.usageScenario = data.usageScenario;
1544− var stageLoader = findChild(shell, "applicationsDisplayLoader");
1545− verify(String(stageLoader.source).indexOf(data.source) >= 0);
1548 function test_launcherInverted_data() {
1531 function test_launcherInverted_data() {
1549 return [
1532 return [
1550 {tag: "phone", formFactor: "phone", usageScenario: "phone", launcherInverted: true},
1533 {tag: "phone", formFactor: "phone", usageScenario: "phone", launcherInverted: true},
@@ -1809,37 +1792,40 @@ Rectangle {
1809 loadDesktopShellWithApps()
1792 loadDesktopShellWithApps()
1811 var stage = findChild(shell, "stage");
1794 var stage = findChild(shell, "stage");
1812− var spread = findChild(stage, "spread");
1795+ var spreadItem = findChild(stage, "spreadItem");
1813− waitForRendering(spread)
1796+// waitForRendering(spread)
1815− var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1798+ var appRepeater = findInvisibleChild(shell, "appRepeater");
1816− verify(spreadRepeater !== null);
1799+ verify(appRepeater !== null);
1818 keyPress(Qt.Key_Alt)
1801 keyPress(Qt.Key_Alt)
1819 keyClick(Qt.Key_Tab);
1802 keyClick(Qt.Key_Tab);
1821 var surface = topLevelSurfaceList.surfaceAt(2);
1804 var surface = topLevelSurfaceList.surfaceAt(2);
1822− var spreadDelegate2 = spreadRepeater.itemAt(2);
1805+ var spreadDelegate2 = appRepeater.itemAt(2);
1823− var clippedSpreadDelegate = findChild(spreadDelegate2, "clippedSpreadDelegate");
1806+ var decoratedWindow = findChild(spreadDelegate2, "decoratedWindow");
1825− tryCompare(spread, "state", "altTab");
1808+ tryCompare(stage, "state", "spread");
1827 // Move the mouse over tile 2 and verify the highlight becomes visible
1810 // Move the mouse over tile 2 and verify the highlight becomes visible
1828 var x = 0;
1811 var x = 0;
1829− var y = shell.height * (data.tileInfo ? .95 : 0.5)
1812+ var y = shell.height * (data.tileInfo ? .9 : 0.5)
1830 mouseMove(shell, x, y)
1813 mouseMove(shell, x, y)
1831− while (spreadRepeater.highlightedIndex !== 2 && x <= 4000) {
1814+ while (spreadItem.highlightedIndex !== 2 && x <= 4000) {
1815+ print("hightlight", spreadItem.highlightedIndex, x, y)
1833 mouseMove(shell, x, y)
1817 mouseMove(shell, x, y)
1834 wait(0); // spin the loop so bindings get evaluated
1818 wait(0); // spin the loop so bindings get evaluated
1836− tryCompare(clippedSpreadDelegate, "highlightShown", true);
1820+ print("hightlight", spreadItem.highlightedIndex)
1821+ tryCompare(decoratedWindow, "showHighlight", true);
1838 // Click the tile
1823 // Click the tile
1839− mouseClick(clippedSpreadDelegate, clippedSpreadDelegate.width / 2, clippedSpreadDelegate.height / 2)
1824+ mouseClick(decoratedWindow, units.gu(2), decoratedWindow.height / 2)
1841 // Verify that we left the spread and app2 is the focused one now
1826 // Verify that we left the spread and app2 is the focused one now
1842− tryCompare(stage, "state", "");
1827+ tryCompare(stage, "state", "windowed");
1828+ print("selected:", surface.name)
1843 tryCompare(surface, "focused", true);
1829 tryCompare(surface, "focused", true);
1845 keyRelease(Qt.Key_Alt);
1831 keyRelease(Qt.Key_Alt);
@@ -1901,41 +1887,6 @@ Rectangle {
1901 tryCompare(hoverMouseArea, "visible", false)
1887 tryCompare(hoverMouseArea, "visible", false)
1904− function test_workspacePreviewsHighlightedApp() {
1905− loadDesktopShellWithApps()
1907− var targetZ = topLevelSurfaceList.count + 1;
1909− var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1910− verify(spreadRepeater !== null);
1912− var appRepeater = findInvisibleChild(shell, "appRepeater");
1913− verify(appRepeater !== null);
1915− keyPress(Qt.Key_Alt)
1916− keyClick(Qt.Key_Tab);
1918− tryCompare(spreadRepeater, "highlightedIndex", 1);
1919− tryCompare(appRepeater.itemAt(1), "z", targetZ)
1922− var y = shell.height * .75;
1923− mouseMove(shell, x, y)
1925− for (var i = 0; i < 7; i++) {
1926− while (spreadRepeater.highlightedIndex != i && x <= 4000) {
1927− tryCompare(appRepeater.itemAt(spreadRepeater.highlightedIndex), "z", targetZ)
1929− mouseMove(shell, x, y)
1930− wait(0); // spin the loop so bindings get evaluated
1936− keyRelease(Qt.Key_Alt);
1939 function test_focusAppFromLauncherExitsSpread_data() {
1890 function test_focusAppFromLauncherExitsSpread_data() {
1940 return [
1891 return [
1941 {tag: "autohide launcher", launcherLocked: false },
1892 {tag: "autohide launcher", launcherLocked: false },
@@ -2267,19 +2218,19 @@ Rectangle {
2267 function test_superTabToCycleLauncher(data) {
2218 function test_superTabToCycleLauncher(data) {
2268 loadShell("desktop");
2219 loadShell("desktop");
2269 shell.usageScenario = "desktop";
2220 shell.usageScenario = "desktop";
2221+ waitForRendering(shell);
2270 GSettingsController.setAutohideLauncher(!data.launcherLocked);
2222 GSettingsController.setAutohideLauncher(!data.launcherLocked);
2271 waitForRendering(shell);
2223 waitForRendering(shell);
2225+ var stage = findChild(shell, "stage");
2273 var launcher = findChild(shell, "launcher");
2226 var launcher = findChild(shell, "launcher");
2274 var launcherPanel = findChild(launcher, "launcherPanel");
2227 var launcherPanel = findChild(launcher, "launcherPanel");
2275 var firstAppInLauncher = LauncherModel.get(0).appId;
2228 var firstAppInLauncher = LauncherModel.get(0).appId;
2277 compare(launcher.state, data.launcherLocked ? "visible": "");
2229 compare(launcher.state, data.launcherLocked ? "visible": "");
2278 compare(launcherPanel.highlightIndex, -2);
2230 compare(launcherPanel.highlightIndex, -2);
2279 compare(ApplicationManager.focusedApplicationId, "unity8-dash");
2231 compare(ApplicationManager.focusedApplicationId, "unity8-dash");
2281 // Use Super + Tab Tab to cycle to the first entry in the launcher
2233 // Use Super + Tab Tab to cycle to the first entry in the launcher
2283 keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2234 keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2284 keyClick(Qt.Key_Tab);
2235 keyClick(Qt.Key_Tab);
2285 tryCompare(launcher, "state", "visible");
2236 tryCompare(launcher, "state", "visible");
@@ -2300,6 +2251,7 @@ Rectangle {
2300 tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2251 tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2301 tryCompare(launcherPanel, "highlightIndex", -2);
2252 tryCompare(launcherPanel, "highlightIndex", -2);
2302 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
2253 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
2254+ tryCompare(stage, "focus", true)
2305 function test_longpressSuperOpensLauncherAndShortcutsOverlay() {
2257 function test_longpressSuperOpensLauncherAndShortcutsOverlay() {
@@ -2360,6 +2312,7 @@ Rectangle {
2360 waitForRendering(shell);
2312 waitForRendering(shell);
2361 var appContainer = findChild(shell, "appContainer");
2313 var appContainer = findChild(shell, "appContainer");
2362 var launcher = findChild(shell, "launcher");
2314 var launcher = findChild(shell, "launcher");
2315+ var launcherPanel = findChild(launcher, "launcherPanel");
2364 var appSurfaceId = topLevelSurfaceList.nextId;
2317 var appSurfaceId = topLevelSurfaceList.nextId;
2365 var app = ApplicationManager.startApplication("music-app");
2318 var app = ApplicationManager.startApplication("music-app");
@@ -2370,12 +2323,15 @@ Rectangle {
2370 waitForRendering(shell);
2323 waitForRendering(shell);
2372 GSettingsController.setAutohideLauncher(true);
2325 GSettingsController.setAutohideLauncher(true);
2326+ tryCompare(launcherPanel, "x", -launcher.panelWidth)
2373 waitForRendering(shell)
2327 waitForRendering(shell)
2374 var hiddenSize = appDelegate.width;
2328 var hiddenSize = appDelegate.width;
2376 GSettingsController.setAutohideLauncher(false);
2330 GSettingsController.setAutohideLauncher(false);
2331+ tryCompare(launcherPanel, "x", 0)
2377 waitForRendering(shell)
2332 waitForRendering(shell)
2378 var shownSize = appDelegate.width;
2333 var shownSize = appDelegate.width;
2334+ print("launcher size:", launcher.panelWidth, "hidden:", hiddenSize, "shown:", shownSize)
2380 compare(shownSize + launcher.panelWidth, hiddenSize);
2336 compare(shownSize + launcher.panelWidth, hiddenSize);