@@ -2781,5 +2781,34 @@ Rectangle {
27812781 }
27822782 tryCompareFunction(function() { return drawer.visible; }, false);
27832783 }
2784+
2785+ function test_restoreFromFullscreen() {
2786+ loadShell("desktop");
2787+ shell.usageScenario = "desktop";
2788+ waitForRendering(shell);
2789+ swipeAwayGreeter();
2790+
2791+ var appSurfaceId = topLevelSurfaceList.nextId;
2792+ var app = ApplicationManager.startApplication("dialer-app")
2793+ waitUntilAppWindowIsFullyLoaded(appSurfaceId);
2794+
2795+ // start dialer
2796+ var appContainer = findChild(shell, "appContainer");
2797+ var appDelegate = findChild(appContainer, "appDelegate_" + appSurfaceId);
2798+ verify(appDelegate);
2799+ tryCompare(appDelegate, "state", "normal");
2800+
2801+ // now maximize to right
2802+ appDelegate.requestMaximizeRight();
2803+ tryCompare(appDelegate, "state", "maximizedRight");
2804+
2805+ // switch to fullscreen
2806+ app.surfaceList.get(0).requestState(Mir.FullscreenState);
2807+ tryCompare(appDelegate, "state", "fullscreen");
2808+
2809+ // restore, should go back to maximizedRight, not restored
2810+ appDelegate.requestRestore();
2811+ tryCompare(appDelegate, "state", "maximizedRight");
2812+ }
27842813 }
27852814}