on xenial help sign in
Fixed tests
2fe1152Nick Dedekind
qml/Panel/Panel.qml+1−1
@@ -55,7 +55,7 @@ Item {
55 id: backMouseEater
55 id: backMouseEater
56 anchors.fill: parent
56 anchors.fill: parent
57 anchors.topMargin: panelHeight
57 anchors.topMargin: panelHeight
58− visible: __indicators.fullyOpened || __applicationMenus.fullyOpened
58+ visible: !indicators.fullyClosed || !applicationMenus.fullyClosed
59 enabled: visible
59 enabled: visible
60 hoverEnabled: true // should also eat hover events, otherwise they will pass through
60 hoverEnabled: true // should also eat hover events, otherwise they will pass through
61
61
tests/qmltests/Panel/tst_Panel.qml+62−2
@@ -250,10 +250,16 @@ PanelTest {
250 panel.fullscreenMode = false;
250 panel.fullscreenMode = false;
251 callManager.foregroundCall = null;
251 callManager.foregroundCall = null;
252
252
253+ PanelState.title = ""
254+
253 panel.indicators.hide();
255 panel.indicators.hide();
254 // Wait for animation to complete
256 // Wait for animation to complete
255 tryCompare(panel.indicators.hideAnimation, "running", false);
257 tryCompare(panel.indicators.hideAnimation, "running", false);
256
258
259+ panel.applicationMenus.hide();
260+ // Wait for animation to complete
261+ tryCompare(panel.applicationMenus.hideAnimation, "running", false);
262+
257 // Wait for the indicators to get into position.
263 // Wait for the indicators to get into position.
258 // (switches between normal and fullscreen modes are animated)
264 // (switches between normal and fullscreen modes are animated)
259 var indicatorArea = findChild(panel, "indicatorArea");
265 var indicatorArea = findChild(panel, "indicatorArea");
@@ -273,7 +279,7 @@ PanelTest {
273 }
279 }
274
280
275 function pullDownIndicatorsMenu() {
281 function pullDownIndicatorsMenu() {
276− var showDragHandle = findChild(panel, "showDragHandle");
282+ var showDragHandle = findChild(panel.indicators, "showDragHandle");
277 touchFlick(showDragHandle,
283 touchFlick(showDragHandle,
278 showDragHandle.width / 2,
284 showDragHandle.width / 2,
279 showDragHandle.height / 2,
285 showDragHandle.height / 2,
@@ -282,6 +288,16 @@ PanelTest {
282 tryCompare(panel.indicators, "fullyOpened", true);
288 tryCompare(panel.indicators, "fullyOpened", true);
283 }
289 }
284
290
291+ function pullDownApplicationsMenu() {
292+ var showDragHandle = findChild(panel.applicationMenus, "showDragHandle");
293+ touchFlick(showDragHandle,
294+ showDragHandle.width / 2,
295+ showDragHandle.height / 2,
296+ showDragHandle.width / 2,
297+ showDragHandle.height / 2 + (showDragHandle.autoCompleteDragThreshold * 1.1));
298+ tryCompare(panel.applicationMenus, "fullyOpened", true);
299+ }
300+
285 function test_drag_show_data() {
301 function test_drag_show_data() {
286 return [
302 return [
287 { tag: "pinned", fullscreen: false, call: null,
303 { tag: "pinned", fullscreen: false, call: null,
@@ -448,7 +464,7 @@ PanelTest {
448 }
464 }
449 }
465 }
450
466
451− function test_darkenedAreaEatsAllEvents() {
467+ function test_darkenedAreaEatsAllIndicatorEvents() {
452
468
453 // The center of the area not covered by the indicators menu
469 // The center of the area not covered by the indicators menu
454 // Ie, the visible darkened area behind the menu
470 // Ie, the visible darkened area behind the menu
@@ -490,6 +506,50 @@ PanelTest {
490 compare(backgroundPressedSpy.count, 2);
506 compare(backgroundPressedSpy.count, 2);
491 }
507 }
492
508
509+ function test_darkenedAreaEatsAllApplicationMenuEvents() {
510+ PanelState.title = "Fake Title"
511+
512+ // The center of the area not covered by the indicators menu
513+ // Ie, the visible darkened area behind the menu
514+ var touchPosX = panel.applicationMenus.width + (panel.width - panel.applicationMenus.width) / 2
515+ var touchPosY = panel.applicationMenus.minimizedPanelHeight +
516+ ((panel.height - panel.applicationMenus.minimizedPanelHeight) / 2)
517+
518+ // input goes through while the indicators menu is closed
519+ tryCompare(panel.applicationMenus, "fullyClosed", true);
520+ compare(backgroundPressedSpy.count, 0);
521+ tap(panel, touchPosX, touchPosY);
522+ compare(backgroundPressedSpy.count, 2);
523+
524+ pullDownApplicationsMenu();
525+
526+ // Darkened area eats input when the indicators menu is fully opened
527+ tap(panel, touchPosX, touchPosY);
528+ compare(backgroundPressedSpy.count, 2);
529+ backgroundPressedSpy.clear();
530+
531+ // And should continue to eat inpunt until the indicators menu is fully closed
532+ wait(10);
533+ while (!panel.applicationMenus.fullyClosed) {
534+ tap(panel, touchPosX, touchPosY);
535+
536+ // it could have got fully closed during the tap
537+ // so we have to double check here
538+ if (!panel.applicationMenus.fullyClosed) {
539+ compare(backgroundPressedSpy.count, 0);
540+ }
541+
542+ // let the animation go a bit further
543+ wait(50);
544+ }
545+
546+ // Now that's fully closed, input should go through again
547+ backgroundPressedSpy.clear();
548+ tap(panel, touchPosX, touchPosY);
549+ compare(backgroundPressedSpy.count, 2);
550+ }
551+
552+
493 /*
553 /*
494 Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1439318
554 Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1439318
495 When the panel is in fullscreen mode and the user taps near the top edge,
555 When the panel is in fullscreen mode and the user taps near the top edge,