on xenial help sign in
add tests
commit88941f7c2b095f9f02402117dcd886b50a746ce1 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 10 Jun 2016, 11:25 (10 years ago) parente586ed5
2 files changed+32
tests/qmltests/Launcher/tst_Launcher.qml+14 tests/qmltests/Panel/tst_IndicatorsMenu.qml+18
tests/qmltests/Launcher/tst_Launcher.qml+14
@@ -210,6 +210,12 @@ Rectangle {
210210 target: LauncherModel
211211 }
212212
213+ SignalSpy {
214+ id: wheelSignalSpy
215+ target: clickThroughTester
216+ signalName: "wheel"
217+ }
218+
213219 Item {
214220 id: fakeDismissTimer
215221 property bool running: false
@@ -1311,5 +1317,13 @@ Rectangle {
13111317 compare(surfacePipRepeater.model, Math.min(3, LauncherModel.get(i).surfaceCount))
13121318 }
13131319 }
1320+
1321+ function test_preventMouseWheelThru(){
1322+ dragLauncherIntoView();
1323+ var launcherPanel = findChild(launcher, "launcherPanel");
1324+ tryCompare(launcherPanel, "visible", true);
1325+ mouseWheel(launcherPanel, launcherPanel.width/2, launcherPanel.height/2, 10, 10);
1326+ tryCompare(wheelSignalSpy, "count", 0);
1327+ }
13141328 }
13151329}
tests/qmltests/Panel/tst_IndicatorsMenu.qml+18
@@ -27,6 +27,17 @@ IndicatorTest {
2727 width: units.gu(80)
2828 height: units.gu(71)
2929
30+ SignalSpy {
31+ id: wheelSignalSpy
32+ target: clickThroughTester
33+ signalName: "wheel"
34+ }
35+
36+ MouseArea {
37+ id: clickThroughTester
38+ anchors.fill: root
39+ }
40+
3041 RowLayout {
3142 anchors.fill: parent
3243 anchors.margins: units.gu(1)
@@ -257,5 +268,12 @@ IndicatorTest {
257268
258269 touchRelease(indicatorsMenu, nextItemMappedPositionX, indicatorsMenu.openedHeight / 3);
259270 }
271+
272+ function test_preventMouseWheelThru() {
273+ indicatorsMenu.show();
274+ tryCompare(indicatorsMenu, "fullyOpened", true);
275+ mouseWheel(indicatorsMenu, indicatorsMenu.width/2, indicatorsMenu.height/2, 10, 10);
276+ tryCompare(wheelSignalSpy, "count", 0);
277+ }
260278 }
261279}