@@ -163,6 +163,16 @@ IndicatorTest {
163163 return indicatorItem;
164164 }
165165
166+ function pullDownIndicatorsMenu() {
167+ var showDragHandle = findChild(panel, "showDragHandle");
168+ touchFlick(showDragHandle,
169+ showDragHandle.width / 2,
170+ showDragHandle.height / 2,
171+ showDragHandle.width / 2,
172+ showDragHandle.height / 2 + (showDragHandle.autoCompleteDragThreshold * 1.1));
173+ tryCompare(panel.indicators, "fullyOpened", true);
174+ }
175+
166176 function test_drag_show_data() {
167177 return [
168178 { tag: "pinned", fullscreen: false, call: null,
@@ -330,5 +340,47 @@ IndicatorTest {
330340
331341 compare(backgroundPressedSpy.count, 0);
332342 }
343+
344+ function test_darkenedAreaEatsAllEvents() {
345+
346+ // The center of the area not covered by the indicators menu
347+ // Ie, the visible darkened area behind the menu
348+ var touchPosX = (panel.width - panel.indicators.width) / 2
349+ var touchPosY = panel.indicators.minimizedPanelHeight +
350+ ((panel.height - panel.indicators.minimizedPanelHeight) / 2)
351+
352+ // input goes through while the indicators menu is closed
353+ tryCompare(panel.indicators, "fullyClosed", true);
354+ compare(backgroundPressedSpy.count, 0);
355+ tap(panel, touchPosX, touchPosY);
356+ compare(backgroundPressedSpy.count, 2);
357+
358+ pullDownIndicatorsMenu();
359+
360+ // Darkened area eats input when the indicators menu is fully opened
361+ tap(panel, touchPosX, touchPosY);
362+ compare(backgroundPressedSpy.count, 2);
363+ backgroundPressedSpy.clear();
364+
365+ // And should continue to eat inpunt until the indicators menu is fully closed
366+ wait(10);
367+ while (!panel.indicators.fullyClosed) {
368+ tap(panel, touchPosX, touchPosY);
369+
370+ // it could have got fully closed during the tap
371+ // so we have to double check here
372+ if (!panel.indicators.fullyClosed) {
373+ compare(backgroundPressedSpy.count, 0);
374+ }
375+
376+ // let the animation go a bit further
377+ wait(50);
378+ }
379+
380+ // Now that's fully closed, input should go through again
381+ backgroundPressedSpy.clear();
382+ tap(panel, touchPosX, touchPosY);
383+ compare(backgroundPressedSpy.count, 2);
384+ }
333385 }
334386}