@@ -129,6 +129,12 @@ Rectangle {
134+ target: WindowStateStorage
135+ signalName: "stageSaved"
132 UnityTestCase {
138 UnityTestCase {
133 id: testCase
139 id: testCase
134 name: "TabletStage"
140 name: "TabletStage"
@@ -138,6 +144,7 @@ Rectangle {
138 property Item sideStage: tabletStage ? findChild(tabletStage, "sideStage") : null
144 property Item sideStage: tabletStage ? findChild(tabletStage, "sideStage") : null
140 function init() {
146 function init() {
141 tabletStageLoader.active = true;
148 tabletStageLoader.active = true;
142 tryCompare(tabletStageLoader, "status", Loader.Ready);
149 tryCompare(tabletStageLoader, "status", Loader.Ready);
@@ -510,7 +517,35 @@ Rectangle {
510 tryCompare(stagesPriv, "sideStageAppId", data.sideStageAppId);
517 tryCompare(stagesPriv, "sideStageAppId", data.sideStageAppId);
513− function test_loadSideStageByDragginFromMainStage() {
520+ function test_applicationSavesLastStage_data() {
522+ { tag: "MainStage", stage: ApplicationInfoInterface.MainStage},
523+ { tag: "SideStage", stage: ApplicationInfoInterface.SideStage},
527+ function test_applicationSavesLastStage(data) {
528+ WindowStateStorage.saveStage(webbrowserCheckBox.appId, data.stage);
531+ var stagesPriv = findInvisibleChild(tabletStage, "stagesPriv");
534+ tryCompare(stagesPriv, "mainStageAppId", "unity8-dash");
535+ tryCompare(stagesPriv, "sideStageAppId", "");
537+ var webbrowserSurfaceId = topSurfaceList.nextId;
538+ webbrowserCheckBox.checked = true;
539+ waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
541+ webbrowserCheckBox.checked = false;
543+ tryCompare(stageSaver, "count", 1);
544+ compare(stageSaver.signalArguments[0][0], "webbrowser-app")
545+ compare(stageSaver.signalArguments[0][1], data.stage)
548+ function test_loadSideStageByDraggingFromMainStage() {
514 sideStage.showNow();
549 sideStage.showNow();
515 var webbrowserSurfaceId = topSurfaceList.nextId;
550 var webbrowserSurfaceId = topSurfaceList.nextId;
516 webbrowserCheckBox.checked = true;
551 webbrowserCheckBox.checked = true;
@@ -538,7 +573,7 @@ Rectangle {
538 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
573 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
541− function test_unloadSideStageByDragginFromStageStage() {
576+ function test_unloadSideStageByDraggingFromStageStage() {
542 sideStage.showNow();
577 sideStage.showNow();
543 WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
578 WindowStateStorage.saveStage(webbrowserCheckBox.appId, ApplicationInfoInterface.SideStage)
544 var webbrowserSurfaceId = topSurfaceList.nextId;
579 var webbrowserSurfaceId = topSurfaceList.nextId;
@@ -690,5 +725,34 @@ Rectangle {
690 // only unity8-dash surface is left
725 // only unity8-dash surface is left
691 compare(topSurfaceList.count, 1);
726 compare(topSurfaceList.count, 1);
729+ function test_draggingSurfaceKeepsSurfaceFocus() {
730+ var webbrowserSurfaceId = topSurfaceList.nextId;
731+ webbrowserCheckBox.checked = true;
732+ waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
734+ var appDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
735+ verify(appDelegate);
736+ compare(appDelegate.stage, ApplicationInfoInterface.MainStage);
738+ tryCompare(appDelegate.surface, "activeFocus", true);
740+ var pos = tabletStage.width - sideStage.width - (tabletStage.width - sideStage.width) / 2;
741+ var end_pos = tabletStage.width - sideStage.width / 2;
743+ multiTouchDragUntil([0,1,2],
746+ tabletStage.height / 2,
751+ return sideStage.shown && !sideStage.showAnimation.running &&
755+ tryCompare(appDelegate.surface, "activeFocus", true);