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