@@ -182,6 +182,12 @@ IndicatorTest {
182 signalName: "pressedChanged"
182 signalName: "pressedChanged"
186+ id: windowControlButtonsSpy
188+ signalName: "closeClicked"
185 function init() {
191 function init() {
186 panel.fullscreenMode = false;
192 panel.fullscreenMode = false;
187 callManager.foregroundCall = null;
193 callManager.foregroundCall = null;
@@ -197,6 +203,8 @@ IndicatorTest {
198 backgroundPressedSpy.clear();
204 backgroundPressedSpy.clear();
199 compare(backgroundPressedSpy.valid, true);
205 compare(backgroundPressedSpy.valid, true);
206+ windowControlButtonsSpy.clear();
207+ compare(windowControlButtonsSpy.valid, true);
202 function get_indicator_item(index) {
210 function get_indicator_item(index) {
@@ -494,5 +502,16 @@ IndicatorTest {
494 compare(panel.indicators.shown, false);
502 compare(panel.indicators.shown, false);
495 tryCompare(panel.indicators, "fullyClosed", true);
503 tryCompare(panel.indicators, "fullyClosed", true);
506+ // https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1611959
507+ function test_windowControlButtonsFittsLaw() {
508+ var buttonsVisible = PanelState.buttonsVisible;
509+ PanelState.buttonsVisible = true;
510+ // click in very topleft corner and verify the close button got clicked too
511+ mouseMove(panel, 0, 0);
512+ mouseClick(panel, 0, 0, undefined /*button*/, undefined /*modifiers*/, 100 /*short delay*/);
513+ compare(windowControlButtonsSpy.count, 1);
514+ PanelState.buttonsVisible = buttonsVisible;