@@ -19,6 +19,7 @@ import QtTest 1.0
19import AccountsService 0.1
19import AccountsService 0.1
20import GSettings 1.0
20import GSettings 1.0
21import LightDM.IntegratedLightDM 0.1 as LightDM
21import LightDM.IntegratedLightDM 0.1 as LightDM
22+import SessionBroadcast 0.1
22import Ubuntu.Components 1.3
23import Ubuntu.Components 1.3
23import Ubuntu.Components.ListItems 1.3 as ListItem
24import Ubuntu.Components.ListItems 1.3 as ListItem
24import Ubuntu.Telephony 0.1 as Telephony
25import Ubuntu.Telephony 0.1 as Telephony
@@ -405,6 +406,18 @@ Rectangle {
405 signalName: "setCurrentScopeCalled"
406 signalName: "setCurrentScopeCalled"
411+ target: SessionBroadcast
412+ signalName: "startUrl"
416+ id: broadcastHomeSpy
417+ target: SessionBroadcast
418+ signalName: "showHome"
408 SignalSpy {
421 SignalSpy {
409 id: unlockAllModemsSpy
422 id: unlockAllModemsSpy
410 target: Connectivity
423 target: Connectivity
@@ -546,6 +559,8 @@ Rectangle {
546 LightDM.Greeter.authenticate(""); // reset greeter
559 LightDM.Greeter.authenticate(""); // reset greeter
548 sessionSpy.clear();
561 sessionSpy.clear();
562+ broadcastUrlSpy.clear();
563+ broadcastHomeSpy.clear();
550 GSettingsController.setLifecycleExemptAppids([]);
565 GSettingsController.setLifecycleExemptAppids([]);
@@ -2420,6 +2435,66 @@ Rectangle {
2420 compare(topmostSurfaceItem.touchReleaseCount, 2);
2435 compare(topmostSurfaceItem.touchReleaseCount, 2);
2438+ function test_greeterModeBroadcastsApp() {
2439+ setLightDMMockMode("single-pin");
2440+ shellLoader.mode = "greeter";
2441+ loadShell("phone");
2442+ shell.usageScenario = "phone";
2443+ waitForRendering(shell);
2445+ dragLauncherIntoView();
2446+ var appIcon = findChild(shell, "launcherDelegate0")
2449+ tryCompare(broadcastUrlSpy, "count", 1);
2450+ compare(broadcastUrlSpy.signalArguments[0][0], "application:///" + appIcon.appId + ".desktop");
2451+ compare(ApplicationManager.count, 1); // confirm only dash is open, we didn't start new app
2453+ var coverPage = findChild(shell, "coverPage");
2454+ tryCompare(coverPage, "showProgress", 0);
2457+ function test_greeterModeBroadcastsHome() {
2458+ setLightDMMockMode("single-pin");
2459+ shellLoader.mode = "greeter";
2460+ loadShell("phone");
2461+ shell.usageScenario = "phone";
2462+ waitForRendering(shell);
2464+ var gallerySurfaceId = topLevelSurfaceList.nextId;
2465+ var galleryApp = ApplicationManager.startApplication("gallery-app");
2466+ waitUntilAppWindowIsFullyLoaded(gallerySurfaceId);
2467+ compare(ApplicationManager.focusedApplicationId, "gallery-app");
2469+ dragLauncherIntoView();
2470+ tap(findChild(shell, "buttonShowDashHome"));
2472+ tryCompare(broadcastHomeSpy, "count", 1);
2473+ compare(ApplicationManager.focusedApplicationId, "gallery-app"); // confirm we didn't focus dash
2475+ var coverPage = findChild(shell, "coverPage");
2476+ tryCompare(coverPage, "showProgress", 0);
2479+ function test_greeterModeDispatchesURL() {
2480+ setLightDMMockMode("single-pin");
2481+ shellLoader.mode = "greeter";
2482+ loadShell("phone");
2483+ shell.usageScenario = "phone";
2484+ waitForRendering(shell);
2486+ var urlDispatcher = findInvisibleChild(shell, "urlDispatcher");
2487+ verify(urlDispatcher.active);
2488+ urlDispatcher.urlRequested("test:"); // force signal emission
2490+ tryCompare(broadcastUrlSpy, "count", 1);
2491+ compare(broadcastUrlSpy.signalArguments[0][0], "test:");
2492+ compare(ApplicationManager.count, 1); // confirm only dash is open, we didn't start new app
2494+ var coverPage = findChild(shell, "coverPage");
2495+ tryCompare(coverPage, "showProgress", 0);
2423 function test_switchKeymap() {
2498 function test_switchKeymap() {
2424 // start with phone shell
2499 // start with phone shell
2425 loadShell("phone");
2500 loadShell("phone");