@@ -573,19 +573,33 @@ Item {
573 compare(topLevelSurfaceList.count, 1);
573 compare(topLevelSurfaceList.count, 1);
576+ function test_launchAppWithSpreadOpen_data() {
578+ { tag: "expected", expected: true },
579+ { tag: "unexpected", expected: false },
578 Check that when an application starts while the spread is open, the
584 Check that when an application starts while the spread is open, the
579 spread closes and that new app is brought to front (gets focused).
585 spread closes and that new app is brought to front (gets focused).
587+ "Expected" means the app is started from the launcher or the spread,
588+ where TLWM's pendingActivation() will be called. "Unexpected" means
589+ the app is launched from outside, such as from the command line.
581− function test_launchAppWithSpreadOpen()
591+ function test_launchAppWithSpreadOpen(data)
583 performEdgeSwipeToShowAppSpread();
593 performEdgeSwipeToShowAppSpread();
596+ topLevelSurfaceList.pendingActivation();
585 var webbrowserSurfaceId = topLevelSurfaceList.nextId;
598 var webbrowserSurfaceId = topLevelSurfaceList.nextId;
586 var webbrowserApp = ApplicationManager.startApplication("morph-browser");
599 var webbrowserApp = ApplicationManager.startApplication("morph-browser");
587 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
600 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
602+ expectFail(/* tag */ "unexpected", "Surprise launch doesn't work properly yet");
589 compare(topLevelSurfaceList.idAt(0), webbrowserSurfaceId);
603 compare(topLevelSurfaceList.idAt(0), webbrowserSurfaceId);
590 compare(webbrowserApp.focused, true);
604 compare(webbrowserApp.focused, true);