on xenial help sign in
add a test for the workspace selector highlight to work
commit9f6da5203f5eda3a9db165bab35debbb148947e3 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 18 Sep 2015, 13:44 (11 years ago) parentc667b8a
1 file changed+35
tests/qmltests/tst_Shell.qml+35
tests/qmltests/tst_Shell.qml+35
@@ -1672,5 +1672,40 @@ Rectangle {
16721672 tryCompare(hoverMouseArea, "enabled", false)
16731673 tryCompare(hoverMouseArea, "visible", false)
16741674 }
1675+
1676+ function test_workspacePreviewsHighlightedApp() {
1677+ loadDesktopShellWithApps()
1678+
1679+ var targetZ = ApplicationManager.count + 1;
1680+
1681+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1682+ verify(spreadRepeater !== null);
1683+
1684+ var appRepeater = findInvisibleChild(shell, "appRepeater");
1685+ verify(appRepeater !== null);
1686+
1687+ keyPress(Qt.Key_Control)
1688+ keyClick(Qt.Key_Tab);
1689+
1690+ tryCompare(spreadRepeater, "highlightedIndex", 1);
1691+ tryCompare(appRepeater.itemAt(1), "z", targetZ)
1692+
1693+ var x = 0;
1694+ var y = shell.height * .75;
1695+ mouseMove(shell, x, y)
1696+
1697+ for (var i = 0; i < 7; i++) {
1698+ while (spreadRepeater.highlightedIndex != i && x <= 4000) {
1699+ tryCompare(appRepeater.itemAt(spreadRepeater.highlightedIndex), "z", targetZ)
1700+ x+=10;
1701+ mouseMove(shell, x, y)
1702+ wait(0); // spin the loop so bindings get evaluated
1703+ }
1704+ }
1705+
1706+ verify(y < 4000);
1707+
1708+ keyRelease(Qt.Key_Control);
1709+ }
16751710 }
16761711}