on xenial help sign in
Fix still-flakey Shell tests
840ffe7Dalton Durst
tests/qmltests/tst_Shell.qml+8−16
@@ -1741,7 +1741,7 @@ Rectangle {
1741 while (spreadItem.highlightedIndex !== 2 && x <= 4000) {
1741 while (spreadItem.highlightedIndex !== 2 && x <= 4000) {
1742 x+=10;
1742 x+=10;
1743 mouseMove(shell, x, y)
1743 mouseMove(shell, x, y)
1744− wait(1); // spin the loop so bindings get evaluated
1744+ wait(10); // spin the loop so bindings get evaluated
1745 }
1745 }
1746 tryCompare(closeMouseArea, "enabled", true)
1746 tryCompare(closeMouseArea, "enabled", true)
1747
1747
@@ -1772,7 +1772,6 @@ Rectangle {
1772
1772
1773 var stage = findChild(shell, "stage");
1773 var stage = findChild(shell, "stage");
1774 var spreadItem = findChild(stage, "spreadItem");
1774 var spreadItem = findChild(stage, "spreadItem");
1775−// waitForRendering(spread)
1776
1775
1777 var appRepeater = findInvisibleChild(shell, "appRepeater");
1776 var appRepeater = findInvisibleChild(shell, "appRepeater");
1778 verify(appRepeater !== null);
1777 verify(appRepeater !== null);
@@ -1793,7 +1792,7 @@ Rectangle {
1793 while (spreadItem.highlightedIndex !== 2 && x <= 4000) {
1792 while (spreadItem.highlightedIndex !== 2 && x <= 4000) {
1794 x+=10;
1793 x+=10;
1795 mouseMove(shell, x, y)
1794 mouseMove(shell, x, y)
1796− wait(1); // spin the loop so bindings get evaluated
1795+ wait(10); // spin the loop so bindings get evaluated
1797 }
1796 }
1798 tryCompare(decoratedWindow, "showHighlight", true);
1797 tryCompare(decoratedWindow, "showHighlight", true);
1799
1798
@@ -1811,6 +1810,7 @@ Rectangle {
1811 loadDesktopShellWithApps()
1810 loadDesktopShellWithApps()
1812
1811
1813 var appRepeater = findInvisibleChild(shell, "appRepeater");
1812 var appRepeater = findInvisibleChild(shell, "appRepeater");
1813+ var launcherPanel = findChild(shell, "launcherPanel");
1814 verify(appRepeater !== null);
1814 verify(appRepeater !== null);
1815
1815
1816 keyPress(Qt.Key_Alt);
1816 keyPress(Qt.Key_Alt);
@@ -1822,22 +1822,14 @@ Rectangle {
1822 compare(spreadFlickable.contentX, 0);
1822 compare(spreadFlickable.contentX, 0);
1823
1823
1824 // Move the mouse to the right and make sure it scrolls the Flickable
1824 // Move the mouse to the right and make sure it scrolls the Flickable
1825− var x = 0;
1825+ var shellLeft = launcherPanel.width + 5;
1826+ var shellRight = shell.width - 5;
1826− var y = shell.height * .5;
1827+ var halfShellHeight = shell.height / 2;
1827− mouseMove(shell, x, y)
1828+ mouseFlick(shell, shellLeft, halfShellHeight, shellRight, halfShellHeight, false, false, units.gu(100));
1828− while (x <= shell.width) {
1829− x+=10;
1830− mouseMove(shell, x, y);
1831− wait(1); // spin the loop so bindings get evaluated
1832− }
1833 tryCompare(spreadFlickable, "contentX", spreadFlickable.contentWidth - spreadFlickable.width);
1829 tryCompare(spreadFlickable, "contentX", spreadFlickable.contentWidth - spreadFlickable.width);
1834
1830
1835 // And turn around
1831 // And turn around
1836− while (x > 0) {
1832+ mouseFlick(shell, shellRight, halfShellHeight, shellLeft, halfShellHeight, false, false, units.gu(100));
1837− x-=10;
1838− mouseMove(shell, x, y)
1839− wait(1); // spin the loop so bindings get evaluated
1840− }
1841 tryCompare(spreadFlickable, "contentX", 0);
1833 tryCompare(spreadFlickable, "contentX", 0);
1842
1834
1843 keyRelease(Qt.Key_Alt);
1835 keyRelease(Qt.Key_Alt);