@@ -251,10 +251,12 @@ PanelTest {
251251
252252 function init() {
253253 panel.mode = "staged";
254+ mouseEmulation.checked = true;
254255 panel.fullscreenMode = false;
255256 callManager.foregroundCall = null;
256257
257− PanelState.title = ""
258+ PanelState.title = "";
259+ PanelState.decorationsVisible = false;
258260
259261 // Wait for the indicators to get into position.
260262 // (switches between normal and fullscreen modes are animated)
@@ -693,13 +695,11 @@ PanelTest {
693695 var windowControlArea = findChild(panel, "windowControlArea");
694696 verify(windowControlArea, "Window control area should have been created in windowed mode")
695697
696− var buttonsVisible = PanelState.decorationsVisible;
697698 PanelState.decorationsVisible = true;
698699 // click in very topleft corner and verify the close button got clicked too
699700 mouseMove(panel, 0, 0);
700701 mouseClick(panel, 0, 0, undefined /*button*/, undefined /*modifiers*/, 100 /*short delay*/);
701702 compare(windowControlButtonsSpy.count, 1);
702− PanelState.decorationsVisible = buttonsVisible;
703703 }
704704
705705 function test_hidingKeyboardIndicator_data() {
@@ -754,5 +754,46 @@ PanelTest {
754754 tryCompareFunction(function() { return dataItem.width > 0.0; }, true);
755755 }
756756 }
757+
758+ function test_stagedApplicationMenuBarShowOnMouseHover() {
759+ PanelState.title = "Fake Title";
760+ panel.mode = "staged";
761+ mouseEmulation.checked = false;
762+
763+ var appTitle = findChild(panel.applicationMenus, "panelTitle"); verify(appTitle);
764+ var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);
765+ var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
766+
767+ tryCompare(appTitle, "visible", true, undefined, "App title should be visible");
768+ tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible");
769+
770+ mouseMove(panel, panel.width/2, panel.panelHeight);
771+
772+ tryCompare(appTitle, "visible", false, undefined, "App title should not be visible on mouse hover");
773+ tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover");
774+ }
775+
776+ function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown() {
777+ PanelState.title = "Fake Title";
778+ panel.mode = "windowed";
779+ mouseEmulation.checked = false;
780+
781+ var appTitle = findChild(panel.applicationMenus, "panelTitle"); verify(appTitle);
782+ var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);
783+ var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
784+
785+ tryCompare(appTitle, "visible", true, undefined, "App title should be visible");
786+ tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible");
787+
788+ mouseMove(panel, panel.width/2, panel.panelHeight);
789+
790+ tryCompare(appTitle, "visible", true, undefined, "App title should still be visible on mouse hover when panel decorations are not visible");
791+ tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should be visible on mouse hover when panel decorations are not visible");
792+
793+ PanelState.decorationsVisible = true;
794+
795+ tryCompare(appTitle, "visible", false, undefined, "App title should still be visible on mouse hover when panel decorations are visible");
796+ tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover when panel decorations not visible");
797+ }
757798 }
758799}