on xenial help sign in
update tests
commitb2444c27e099bd75038a99fdf1271a9b2117b900 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 10 Jan 2017, 13:00 (10 years ago) parenta845c9b
5 files changed+13−110
qml/Launcher/Launcher.qml+4−4 qml/Launcher/LauncherPanel.qml+2 tests/qmltests/Dash/tst_DashShell.qml−40 tests/qmltests/Launcher/tst_Launcher.qml+2−2 tests/qmltests/tst_Shell.qml+5−64
qml/Launcher/Launcher.qml+4−4
@@ -87,14 +87,14 @@ FocusScope {
8787 superPressTimer.stop();
8888 superLongPressTimer.stop();
8989 } else {
90+ switchToNextState("");
91+ root.focus = false;
9092 if (panel.highlightIndex == -1) {
91− showDashHome();
93+ root.showDashHome();
9294 } else if (panel.highlightIndex >= 0){
9395 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
9496 }
9597 panel.highlightIndex = -2;
96− switchToNextState("");
97− root.focus = false;
9898 }
9999 }
100100
@@ -206,7 +206,7 @@ FocusScope {
206206 case Qt.Key_Return:
207207 case Qt.Key_Space:
208208 if (panel.highlightIndex == -1) {
209− showDashHome();
209+ root.showDashHome();
210210 } else if (panel.highlightIndex >= 0) {
211211 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
212212 }
qml/Launcher/LauncherPanel.qml+2
@@ -777,6 +777,8 @@ Rectangle {
777777 quickList.model = launcherListView.model.get(index).quickList;
778778 quickList.appId = launcherListView.model.get(index).appId;
779779 quickList.state = "open";
780+ root.highlightIndex = index;
781+ quickList.forceActiveFocus();
780782 }
781783
782784 Item {
tests/qmltests/Dash/tst_DashShell.qml−40
@@ -72,45 +72,5 @@ Item {
7272 true, 15000);
7373 waitForRendering(findChild(dash, "scopeLoader0").item);
7474 }
75−
76− function test_setShellHome() {
77− var dashContentList = findChild(dash, "dashContentList");
78− var startX = dash.width - units.gu(1);
79− var startY = dash.height / 2;
80− var stopX = units.gu(1)
81− var stopY = startY;
82− waitForRendering(dashContentList);
83− touchFlick(dash, startX, startY, stopX, stopY);
84− touchFlick(dash, startX, startY, stopX, stopY);
85− compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
86−
87− // Flick the greeter away
88− var startX = shell.width - units.gu(1);
89− var startY = shell.height / 2;
90− var stopX = units.gu(1)
91− var stopY = startY;
92− touchFlick(shell, startX, startY, stopX, stopY);
93−
94− var greeter = findChild(shell, "greeter");
95− tryCompare(greeter, "shown", false);
96−
97− // bring in the launcher
98− var startX = units.gu(1);
99− var startY = shell.height / 2;
100− var stopX = shell.width / 3;
101− var stopY = startY;
102− touchFlick(shell, startX, startY, stopX, stopY);
103−
104− var launcher = findChild(shell, "launcher");
105− var buttonShowDashHome = findChild(launcher, "buttonShowDashHome");
106− tryCompare(buttonShowDashHome, "enabled", true);
107− tryCompare(launcher, "visibleWidth", launcher.panelWidth);
108−
109− // Make sure that opening the launcher doesn't change the scope
110− compare(dashContentList.currentIndex, 2, "Opening the launcher changed the current scope");
111−
112− mouseClick(buttonShowDashHome);
113− tryCompare(dashContentList, "currentIndex", 0);
114− }
11575 }
11676}
tests/qmltests/Launcher/tst_Launcher.qml+2−2
@@ -1187,13 +1187,13 @@ Rectangle {
11871187 }
11881188
11891189 function test_keyboardNavigation(data) {
1190− var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
1190+ var bfb = findChild(launcher, "buttonShowDashHome");
11911191 var quickList = findChild(launcher, "quickList");
11921192 var launcherPanel = findChild(launcher, "launcherPanel");
11931193 var launcherListView = findChild(launcher, "launcherListView");
11941194 var last = launcherListView.count - 1;
11951195
1196− compare(bfbFocusHighlight.visible, false);
1196+ compare(bfb.highlighted, false);
11971197 launcher.openForKeyboardNavigation();
11981198 tryCompare(launcherPanel, "x", 0);
11991199 waitForRendering(launcher);
tests/qmltests/tst_Shell.qml+5−64
@@ -739,22 +739,6 @@ Rectangle {
739739 mockNotificationsModel.append(n)
740740 }
741741
742− function test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
743− loadShell("phone");
744− swipeAwayGreeter();
745− dragLauncherIntoView();
746− dashCommunicatorSpy.clear();
747−
748− var launcher = findChild(shell, "launcher");
749− var dashIcon = findChild(launcher, "dashItem");
750− verify(dashIcon != undefined);
751− mouseClick(dashIcon);
752−
753− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
754−
755− compare(dashCommunicatorSpy.count, 1);
756− }
757−
758742 function test_suspend() {
759743 loadShell("phone");
760744 swipeAwayGreeter();
@@ -1372,47 +1356,6 @@ Rectangle {
13721356 tryCompare(stage, "state", "spread");
13731357 }
13741358
1375− function test_tapUbuntuIconInLauncherOverAppSpread() {
1376− launcherShowDashHomeSpy.clear();
1377−
1378− loadShell("phone");
1379− swipeAwayGreeter();
1380−
1381− waitUntilFocusedApplicationIsShowingItsSurface();
1382−
1383− swipeFromRightEdgeToShowAppSpread();
1384−
1385− var launcher = findChild(shell, "launcher");
1386−
1387− dragLauncherIntoView();
1388−
1389− // Emulate a tap with a finger, where the touch position drifts during the tap.
1390− // This is to test the touch ownership changes. The tap is happening on the button
1391− // area but then drifting into the left edge drag area. This test makes sure
1392− // the touch ownership stays with the button and doesn't move over to the
1393− // left edge drag area.
1394− {
1395− var buttonShowDashHome = findChild(launcher, "buttonShowDashHome");
1396− touchFlick(buttonShowDashHome,
1397− buttonShowDashHome.width * 0.2, /* startPos.x */
1398− buttonShowDashHome.height * 0.8, /* startPos.y */
1399− buttonShowDashHome.width * 0.8, /* endPos.x */
1400− buttonShowDashHome.height * 0.2 /* endPos.y */);
1401− }
1402−
1403− compare(launcherShowDashHomeSpy.count, 1);
1404−
1405− // check that the stage has left spread mode.
1406− {
1407− var stage = findChild(shell, "stage");
1408− tryCompare(stage, "state", "staged");
1409− }
1410−
1411− // check that the launcher got dismissed
1412− var launcherPanel = findChild(shell, "launcherPanel");
1413− tryCompare(launcherPanel, "x", -launcherPanel.width);
1414− }
1415−
14161359 function test_physicalHomeKeyPressDoesNothingWithActiveGreeter() {
14171360 loadShell("phone");
14181361
@@ -1839,7 +1782,7 @@ Rectangle {
18391782 loadDesktopShellWithApps()
18401783 var launcher = findChild(shell, "launcher");
18411784 var stage = findChild(shell, "stage");
1842− var bfb = findChild(launcher, "buttonShowDashHome");
1785+ var app1 = findChild(launcher, "launcherDelegate0");
18431786
18441787 GSettingsController.setAutohideLauncher(!data.launcherLocked);
18451788 waitForRendering(shell);
@@ -1852,17 +1795,17 @@ Rectangle {
18521795 if (!data.launcherLocked) {
18531796 revealLauncherByEdgePushWithMouse();
18541797 tryCompare(launcher, "x", 0);
1855− mouseMove(bfb, bfb.width / 2, bfb.height / 2)
1798+ mouseMove(app1, app1.width / 2, app1.height / 2)
18561799 waitForRendering(shell)
18571800 }
18581801
1859− mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1802+ mouseClick(app1, app1.width / 2, app1.height / 2)
18601803 if (!data.launcherLocked) {
18611804 tryCompare(launcher, "state", "")
18621805 }
18631806 tryCompare(stage, "state", "windowed")
18641807
1865− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
1808+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app")
18661809
18671810 keyRelease(Qt.Key_Alt);
18681811 }
@@ -2185,10 +2128,8 @@ Rectangle {
21852128 tryCompare(launcher, "state", "visible");
21862129 tryCompare(launcherPanel, "highlightIndex", -1);
21872130 keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2188− tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2131+ tryCompare(launcher, "state", "drawer");
21892132 tryCompare(launcherPanel, "highlightIndex", -2);
2190− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
2191− tryCompare(stage, "focus", true)
21922133 }
21932134
21942135 function test_longpressSuperOpensLauncherAndShortcutsOverlay() {