on xenial help sign in
add tests
88941f7Lukáš Tinkl
tests/qmltests/Launcher/tst_Launcher.qml+14
@@ -210,6 +210,12 @@ Rectangle {
210 target: LauncherModel
210 target: LauncherModel
211 }
211 }
212
212
213+ SignalSpy {
214+ id: wheelSignalSpy
215+ target: clickThroughTester
216+ signalName: "wheel"
217+ }
218+
213 Item {
219 Item {
214 id: fakeDismissTimer
220 id: fakeDismissTimer
215 property bool running: false
221 property bool running: false
@@ -1311,5 +1317,13 @@ Rectangle {
1311 compare(surfacePipRepeater.model, Math.min(3, LauncherModel.get(i).surfaceCount))
1317 compare(surfacePipRepeater.model, Math.min(3, LauncherModel.get(i).surfaceCount))
1312 }
1318 }
1313 }
1319 }
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+ }
1314 }
1328 }
1315}
1329}
tests/qmltests/Panel/tst_IndicatorsMenu.qml+18
@@ -27,6 +27,17 @@ IndicatorTest {
27 width: units.gu(80)
27 width: units.gu(80)
28 height: units.gu(71)
28 height: units.gu(71)
29
29
30+ SignalSpy {
31+ id: wheelSignalSpy
32+ target: clickThroughTester
33+ signalName: "wheel"
34+ }
35+
36+ MouseArea {
37+ id: clickThroughTester
38+ anchors.fill: root
39+ }
40+
30 RowLayout {
41 RowLayout {
31 anchors.fill: parent
42 anchors.fill: parent
32 anchors.margins: units.gu(1)
43 anchors.margins: units.gu(1)
@@ -257,5 +268,12 @@ IndicatorTest {
257
268
258 touchRelease(indicatorsMenu, nextItemMappedPositionX, indicatorsMenu.openedHeight / 3);
269 touchRelease(indicatorsMenu, nextItemMappedPositionX, indicatorsMenu.openedHeight / 3);
259 }
270 }
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+ }
260 }
278 }
261}
279}