@@ -1,5 +1,5 @@
2− * Copyright (C) 2013-2014 Canonical, Ltd.
2+ * Copyright (C) 2013-2015 Canonical, Ltd.
5 * Daniel d'Andrada <daniel.dandrada@canonical.com>
5 * Daniel d'Andrada <daniel.dandrada@canonical.com>
@@ -31,12 +31,14 @@ import Unity.Indicators 0.1
31import Unity.Notifications 1.0
31import Unity.Notifications 1.0
32import Unity.Test 0.1
32import Unity.Test 0.1
33import Powerd 0.1
33import Powerd 0.1
34+import Wizard 0.1 as Wizard
35import "../../qml"
36import "../../qml"
39− width: units.gu(70)
41+ width: units.gu(100) + controls.width
40 height: units.gu(71)
42 height: units.gu(71)
42 Component.onCompleted: {
44 Component.onCompleted: {
@@ -62,12 +64,37 @@ Item {
66− anchors.fill: parent
68+ anchors.left: root.left
69+ anchors.right: controls.left
70+ anchors.top: root.top
71+ anchors.bottom: root.bottom
68 id: shellLoader
73 id: shellLoader
69 focus: true
74 focus: true
76+ anchors.centerIn: parent
71 active: false
98 active: false
72 property bool itemDestroyed: false
99 property bool itemDestroyed: false
73 sourceComponent: Component {
100 sourceComponent: Component {
@@ -80,42 +107,56 @@ Item {
116+ anchors.top: root.top
117+ anchors.bottom: root.bottom
118+ anchors.right: root.right
121+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
122+ spacing: units.gu(1)
124+ anchors { left: parent.left; right: parent.right }
126+ text: "Show Greeter"
127+ activeFocusOnPress: false
129+ if (shellLoader.status !== Loader.Ready)
87− height: shellLoader.height
90− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
93− anchors { left: parent.left; right: parent.right }
96− activeFocusOnPress: false
98− if (shellLoader.status !== Loader.Ready)
101− var greeter = testCase.findChild(shellLoader.item, "greeter");
132+ var greeter = testCase.findChild(shellLoader.item, "greeter");
102− if (!greeter.shown) {
133+ if (!greeter.shown) {
103− LightDM.Greeter.showGreeter();
134+ LightDM.Greeter.showGreeter();
108− ListItem.ItemSelector {
139+ ListItem.ItemSelector {
109− anchors { left: parent.left; right: parent.right }
140+ anchors { left: parent.left; right: parent.right }
110− activeFocusOnPress: false
141+ activeFocusOnPress: false
111− text: "LightDM mock mode"
142+ text: "LightDM mock mode"
112− model: ["single", "single-passphrase", "single-pin"]
143+ model: ["single", "single-passphrase", "single-pin", "full"]
113− onSelectedIndexChanged: {
144+ onSelectedIndexChanged: {
114− shellLoader.active = false;
145+ shellLoader.active = false;
115− LightDM.Greeter.mockMode = model[selectedIndex];
146+ LightDM.Greeter.mockMode = model[selectedIndex];
116− LightDM.Users.mockMode = model[selectedIndex];
147+ LightDM.Users.mockMode = model[selectedIndex];
117− shellLoader.active = true;
148+ shellLoader.active = true;
151+ ListItem.ItemSelector {
152+ anchors { left: parent.left; right: parent.right }
153+ activeFocusOnPress: false
155+ model: ["phone", "tablet"]
156+ onSelectedIndexChanged: {
157+ shellLoader.active = false;
158+ shellLoader.state = model[selectedIndex];
159+ shellLoader.active = true;
120 MouseTouchEmulationCheckbox { color: "white" }
161 MouseTouchEmulationCheckbox { color: "white" }
@@ -187,20 +228,49 @@ Item {
187 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
228 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
189 function init() {
230 function init() {
190− tryCompare(shell, "enabled", true); // enabled by greeter when ready
231+ if (shellLoader.active) {
191− shell.indicatorProfile = "phone";
232+ // happens for the very first test function as shell
233+ // is loaded by default
193− swipeAwayGreeter();
237+ }
239+ function cleanup() {
240+ tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
244+ function loadShell(formFactor) {
245+ shellLoader.state = formFactor;
246+ shellLoader.active = true;
247+ tryCompare(shellLoader, "status", Loader.Ready);
248+ removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
249+ tryCompare(shell, "enabled", true); // enabled by greeter when ready
195 sessionSpy.target = findChild(shell, "greeter")
251 sessionSpy.target = findChild(shell, "greeter")
196 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
252 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
198 var launcher = findChild(shell, "launcher");
254 var launcher = findChild(shell, "launcher");
199 launcherShowDashHomeSpy.target = launcher;
255 launcherShowDashHomeSpy.target = launcher;
257+ waitForGreeterToStabilize();
202− function cleanup() {
260+ function waitForGreeterToStabilize() {
203− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
261+ var greeter = findChild(shell, "greeter");
264+ var loginList = findChild(greeter, "loginList");
265+ // Only present in WideView
267+ var userList = findChild(loginList, "userList");
269+ tryCompare(userList, "movingInternally", false);
273+ function tearDown() {
204 launcherShowDashHomeSpy.target = null;
274 launcherShowDashHomeSpy.target = null;
206 shellLoader.itemDestroyed = false;
276 shellLoader.itemDestroyed = false;
@@ -217,17 +287,18 @@ Item {
217 // Shell instance gets destroyed.
287 // Shell instance gets destroyed.
218 tryCompare(shellLoader, "itemDestroyed", true);
288 tryCompare(shellLoader, "itemDestroyed", true);
290+ setLightDMMockMode("single"); // back to the default value
292+ AccountsService.demoEdges = false;
293+ Wizard.System.wizardEnabled = false;
220 // kill all (fake) running apps
295 // kill all (fake) running apps
221 killApps(ApplicationManager);
296 killApps(ApplicationManager);
223 unlockAllModemsSpy.clear()
298 unlockAllModemsSpy.clear()
224 LightDM.Greeter.authenticate(""); // reset greeter
299 LightDM.Greeter.authenticate(""); // reset greeter
226− // reload our test subject to get it in a fresh state once again
301+ sessionSpy.clear();
227− shellLoader.active = true;
229− tryCompare(shellLoader, "status", Loader.Ready);
230− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
233 function killApps() {
304 function killApps() {
@@ -239,6 +310,8 @@ Item {
241 function test_snapDecisionDismissalReturnsFocus() {
312 function test_snapDecisionDismissalReturnsFocus() {
242 var notifications = findChild(shell, "notificationList");
315 var notifications = findChild(shell, "notificationList");
243 var app = ApplicationManager.startApplication("camera-app");
316 var app = ApplicationManager.startApplication("camera-app");
244 var stage = findChild(shell, "stage")
317 var stage = findChild(shell, "stage")
@@ -297,19 +370,41 @@ Item {
297 mockNotificationsModel.append(n)
370 mockNotificationsModel.append(n)
300− function test_leftEdgeDrag_data() {
373+ function test_phoneLeftEdgeDrag_data() {
375+ {tag: "without launcher",
302− {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
376+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
377+ launcherHides: true, greeterShown: false},
379+ {tag: "with launcher",
303− {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
380+ revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
381+ launcherHides: true, greeterShown: false},
383+ {tag: "small swipe",
304− {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: false},
384+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
385+ launcherHides: false, greeterShown: false},
305− {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
388+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
389+ launcherHides: true, greeterShown: false},
391+ {tag: "small swipe with greeter",
306− {tag: "small swipe with greeter", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: true},
392+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
393+ launcherHides: false, greeterShown: true},
395+ {tag: "long swipe with greeter",
307− {tag: "long swipe with greeter", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: true},
396+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
397+ launcherHides: true, greeterShown: true},
399+ {tag: "swipe over dash",
308− {tag: "swipe over dash", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash", launcherHides: false, greeterShown: false},
400+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
401+ launcherHides: false, greeterShown: false},
312− function test_leftEdgeDrag(data) {
405+ function test_phoneLeftEdgeDrag(data) {
313 dragLauncherIntoView();
408 dragLauncherIntoView();
314 tapOnAppIconInLauncher();
409 tapOnAppIconInLauncher();
315 waitUntilApplicationWindowIsFullyVisible();
410 waitUntilApplicationWindowIsFullyVisible();
@@ -342,7 +437,32 @@ Item {
342 compare(animateTimer.nextState, "visible");
437 compare(animateTimer.nextState, "visible");
440+ function test_tabletLeftEdgeDrag_data() {
442+ {tag: "without password", user: "no-password", loggedIn: true, demo: false},
443+ {tag: "with password", user: "has-password", loggedIn: false, demo: false},
444+ {tag: "with demo", user: "has-password", loggedIn: true, demo: true},
448+ function test_tabletLeftEdgeDrag(data) {
449+ setLightDMMockMode("full");
450+ loadShell("tablet");
452+ selectUser(data.user)
454+ AccountsService.demoEdges = data.demo
455+ var tutorial = findChild(shell, "tutorial");
456+ tryCompare(tutorial, "running", data.demo);
458+ swipeFromLeftEdge(shell.width * 0.75)
459+ wait(500) // to give time to handle dash() signal from Launcher
460+ confirmLoggedIn(data.loggedIn)
345 function test_suspend() {
463 function test_suspend() {
346 var greeter = findChild(shell, "greeter");
466 var greeter = findChild(shell, "greeter");
348 // Launch an app from the launcher
468 // Launch an app from the launcher
@@ -402,6 +522,61 @@ Item {
402 waitForRendering(greeter);
522 waitForRendering(greeter);
525+ function selectUserAtIndex(i) {
526+ // We could be anywhere in list; find target index to know which direction
527+ var greeter = findChild(shell, "greeter")
528+ var userlist = findChild(greeter, "userList")
529+ if (userlist.currentIndex == i)
530+ keyClick(Qt.Key_Escape) // Reset state if we're not moving
531+ while (userlist.currentIndex != i) {
532+ var next = userlist.currentIndex + 1
533+ if (userlist.currentIndex > i) {
534+ next = userlist.currentIndex - 1
536+ tap(findChild(greeter, "username"+next));
537+ tryCompare(userlist, "currentIndex", next)
538+ tryCompare(userlist, "movingInternally", false)
540+ tryCompare(shell, "enabled", true); // wait for PAM to settle
543+ function selectUser(name) {
544+ // Find index of user with the right name
545+ for (var i = 0; i < LightDM.Users.count; i++) {
546+ if (LightDM.Users.data(i, LightDM.UserRoles.NameRole) == name) {
550+ if (i == LightDM.Users.count) {
551+ fail("Didn't find name")
554+ selectUserAtIndex(i)
558+ function clickPasswordInput(isButton) {
559+ var greeter = findChild(shell, "greeter")
560+ tryCompare(greeter, "fullyShown", true);
562+ var passwordMouseArea = findChild(shell, "passwordMouseArea")
563+ tryCompare(passwordMouseArea, "enabled", isButton)
565+ var passwordInput = findChild(shell, "passwordInput")
566+ mouseClick(passwordInput)
569+ function confirmLoggedIn(loggedIn) {
570+ var greeter = findChild(shell, "greeter");
571+ tryCompare(greeter, "shown", loggedIn ? false : true);
572+ verify(loggedIn ? sessionSpy.count > 0 : sessionSpy.count === 0);
575+ function setLightDMMockMode(mode) {
576+ LightDM.Greeter.mockMode = mode;
577+ LightDM.Users.mockMode = mode;
406 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
581 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
@@ -414,6 +589,8 @@ Item {
414 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
589 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
416 function test_minimizingAppTakesToDashApps() {
591 function test_minimizingAppTakesToDashApps() {
417 dragLauncherIntoView();
594 dragLauncherIntoView();
419 // Launch an app from the launcher
596 // Launch an app from the launcher
@@ -434,6 +611,8 @@ Item {
436 function test_showInputMethod() {
613 function test_showInputMethod() {
437 var item = findChild(shell, "inputMethod");
616 var item = findChild(shell, "inputMethod");
438 var surface = SurfaceManager.inputMethodSurface();
617 var surface = SurfaceManager.inputMethodSurface();
@@ -472,6 +651,8 @@ Item {
474 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
653 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
475 var app = ApplicationManager.startApplication("dialer-app");
656 var app = ApplicationManager.startApplication("dialer-app");
476 waitUntilAppWindowIsFullyLoaded(app);
657 waitUntilAppWindowIsFullyLoaded(app);
@@ -502,28 +683,26 @@ Item {
502 tryCompare(app.session.surface, "activeFocus", true);
683 tryCompare(app.session.surface, "activeFocus", true);
686+ function test_launchedAppHasActiveFocus_data() {
688+ {tag:"phone", formFactor:"phone"},
689+ {tag:"tablet", formFactor:"tablet"},
505− function test_launchedAppHasActiveFocus() {
693+ function test_launchedAppHasActiveFocus(data) {
694+ loadShell(data.formFactor);
506− var dialerApp = ApplicationManager.startApplication("dialer-app");
697+ var dialerApp = ApplicationManager.startApplication("webbrowser-app");
507 verify(dialerApp);
698 verify(dialerApp);
508− waitUntilAppSurfaceShowsUp("dialer-app")
699+ waitUntilAppSurfaceShowsUp("webbrowser-app")
510 verify(dialerApp.session.surface);
701 verify(dialerApp.session.surface);
512 tryCompare(dialerApp.session.surface, "activeFocus", true);
703 tryCompare(dialerApp.session.surface, "activeFocus", true);
515− // Wait for the whole UI to settle down
516− function waitForUIToSettle() {
517− var launcher = findChild(shell, "launcherPanel")
518− tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
519− if (launcher.x === 0) {
522− tryCompare(launcher, "x", -launcher.width)
524− waitForRendering(shell)
527 function waitUntilAppSurfaceShowsUp(appId) {
706 function waitUntilAppSurfaceShowsUp(appId) {
528 var appWindow = findChild(shell, "appWindow_" + appId);
707 var appWindow = findChild(shell, "appWindow_" + appId);
529 verify(appWindow);
708 verify(appWindow);
@@ -616,6 +795,8 @@ Item {
618 function test_greeterDoesNotChangeIndicatorProfile() {
797 function test_greeterDoesNotChangeIndicatorProfile() {
619 var panel = findChild(shell, "panel");
800 var panel = findChild(shell, "panel");
620 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
801 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
@@ -627,6 +808,8 @@ Item {
629 function test_shellProfileChangesReachIndicators() {
810 function test_shellProfileChangesReachIndicators() {
630 var panel = findChild(shell, "panel");
813 var panel = findChild(shell, "panel");
632 shell.indicatorProfile = "test1";
815 shell.indicatorProfile = "test1";
@@ -643,6 +826,8 @@ Item {
645 function test_focusRequestedHidesGreeter() {
828 function test_focusRequestedHidesGreeter() {
646 var greeter = findChild(shell, "greeter");
831 var greeter = findChild(shell, "greeter");
648 var app = ApplicationManager.startApplication("dialer-app");
833 var app = ApplicationManager.startApplication("dialer-app");
@@ -663,6 +848,8 @@ Item {
665 function test_focusRequestedHidesIndicators() {
850 function test_focusRequestedHidesIndicators() {
666 var indicators = findChild(shell, "indicators");
853 var indicators = findChild(shell, "indicators");
668 showIndicators();
855 showIndicators();
@@ -675,6 +862,8 @@ Item {
677 function test_showAndHideGreeterDBusCalls() {
864 function test_showAndHideGreeterDBusCalls() {
678 var greeter = findChild(shell, "greeter")
867 var greeter = findChild(shell, "greeter")
679 tryCompare(greeter, "shown", false)
868 tryCompare(greeter, "shown", false)
680 waitForRendering(greeter);
869 waitForRendering(greeter);
@@ -686,6 +875,8 @@ Item {
688 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
877 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
689 sessionSpy.clear();
880 sessionSpy.clear();
690 verify(sessionSpy.valid);
881 verify(sessionSpy.valid);
@@ -695,6 +886,8 @@ Item {
697 function test_fullscreen() {
888 function test_fullscreen() {
698 var panel = findChild(shell, "panel");
891 var panel = findChild(shell, "panel");
699 compare(panel.fullscreenMode, false);
892 compare(panel.fullscreenMode, false);
700 ApplicationManager.startApplication("camera-app");
893 ApplicationManager.startApplication("camera-app");
@@ -708,6 +901,8 @@ Item {
710 function test_leftEdgeDragFullscreen() {
903 function test_leftEdgeDragFullscreen() {
711 var panel = findChild(shell, "panel");
906 var panel = findChild(shell, "panel");
712 tryCompare(panel, "fullscreenMode", false)
907 tryCompare(panel, "fullscreenMode", false)
@@ -729,6 +924,8 @@ Item {
731 function test_unlockedProperties() {
926 function test_unlockedProperties() {
732 // Confirm that various properties have the correct values when unlocked
929 // Confirm that various properties have the correct values when unlocked
733 var greeter = findChild(shell, "greeter");
930 var greeter = findChild(shell, "greeter");
734 tryCompare(greeter, "locked", false);
931 tryCompare(greeter, "locked", false);
@@ -741,10 +938,60 @@ Item {
743 function test_unlockAllModemsOnBoot() {
940 function test_unlockAllModemsOnBoot() {
744 tryCompare(unlockAllModemsSpy, "count", 1)
943 tryCompare(unlockAllModemsSpy, "count", 1)
946+ function test_unlockAllModemsAfterWizard() {
947+ Wizard.System.wizardEnabled = true;
950+ var wizard = findChild(shell, "wizard");
951+ compare(wizard.active, true);
952+ compare(Wizard.System.wizardEnabled, true);
953+ compare(unlockAllModemsSpy.count, 0);
956+ tryCompare(wizard, "active", false);
957+ compare(Wizard.System.wizardEnabled, false);
958+ compare(unlockAllModemsSpy.count, 1);
961+ function test_wizardEarlyExit() {
962+ Wizard.System.wizardEnabled = true;
963+ AccountsService.demoEdges = true;
966+ var wizard = findChild(shell, "wizard");
967+ var tutorial = findChild(shell, "tutorial");
968+ tryCompare(wizard, "active", true);
969+ tryCompare(tutorial, "running", true);
970+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
972+ // Make sure we stay running when nothing focused (can happen for
973+ // a moment when we restart the dash after switching language)
974+ ApplicationManager.stopApplication("unity8-dash");
975+ tryCompare(ApplicationManager, "focusedApplicationId", "");
976+ compare(wizard.shown, true);
977+ compare(tutorial.running, true);
979+ // And make sure we stay running when dash focused again
980+ ApplicationManager.startApplication("unity8-dash");
981+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
982+ compare(wizard.shown, true);
983+ compare(tutorial.running, true);
985+ // And make sure we stop when something else is focused
986+ ApplicationManager.startApplication("gallery-app");
987+ tryCompare(ApplicationManager, "focusedApplicationId", "gallery-app");
988+ compare(wizard.shown, false);
989+ compare(tutorial.running, false);
747 function test_tapOnRightEdgeReachesApplicationSurface() {
992 function test_tapOnRightEdgeReachesApplicationSurface() {
748 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
995 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
749 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
996 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
750 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
997 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -767,6 +1014,8 @@ Item {
767 by the right-edge drag area)
1014 by the right-edge drag area)
769 function test_rightEdgeDragDoesNotReachApplicationSurface() {
1016 function test_rightEdgeDragDoesNotReachApplicationSurface() {
1017+ loadShell("phone");
1018+ swipeAwayGreeter();
770 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
1019 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
771 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
1020 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
772 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
1021 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -811,6 +1060,8 @@ Item {
813 function test_tapUbuntuIconInLauncherOverAppSpread() {
1062 function test_tapUbuntuIconInLauncherOverAppSpread() {
1063+ loadShell("phone");
1064+ swipeAwayGreeter();
815 waitUntilFocusedApplicationIsShowingItsSurface();
1066 waitUntilFocusedApplicationIsShowingItsSurface();
@@ -857,18 +1108,75 @@ Item {
857 function test_background_data() {
1108 function test_background_data() {
858 return [
1109 return [
859 {tag: "color", accounts: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>"), gsettings: "", output: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>")},
1110 {tag: "color", accounts: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>"), gsettings: "", output: Qt.resolvedUrl("data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#dd4814'/></svg>")},
860− {tag: "empty", accounts: "", gsettings: "", output: shell.defaultBackground},
1111+ {tag: "empty", accounts: "", gsettings: "", output: "defaultBackground"},
861 {tag: "as-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: "", output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
1112 {tag: "as-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: "", output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
862 {tag: "gs-specified", accounts: "", gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
1113 {tag: "gs-specified", accounts: "", gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
863 {tag: "both-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
1114 {tag: "both-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
864 {tag: "invalid-as", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
1115 {tag: "invalid-as", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
865− {tag: "invalid-both", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"), output: shell.defaultBackground},
1116+ {tag: "invalid-both", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"), output: "defaultBackground"},
868 function test_background(data) {
1119 function test_background(data) {
1120+ loadShell("phone");
1121+ swipeAwayGreeter();
869 AccountsService.backgroundFile = data.accounts;
1122 AccountsService.backgroundFile = data.accounts;
870− GSettingsController.setPictureUri("org.gnome.desktop.background", data.gsettings);
1123+ var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
1124+ backgroundSettings.pictureUri = data.gsettings;
1126+ if (data.output === "defaultBackground") {
1127+ tryCompare(shell, "background", shell.defaultBackground);
871− tryCompare(shell, "background", data.output);
1129+ tryCompare(shell, "background", data.output);
1133+ function test_tabletLogin_data() {
1135+ {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1136+ {tag: "with password", user: "has-password", loggedIn: true, password: "password"},
1137+ {tag: "without password", user: "no-password", loggedIn: true, password: ""},
1141+ function test_tabletLogin(data) {
1142+ setLightDMMockMode("full");
1143+ loadShell("tablet");
1145+ selectUser(data.user);
1147+ clickPasswordInput(data.password === "" /* isButton */);
1149+ if (data.password !== "") {
1150+ typeString(data.password);
1151+ keyClick(Qt.Key_Enter);
1154+ confirmLoggedIn(data.loggedIn);
1157+ function test_appLaunchDuringGreeter_data() {
1159+ {tag: "auth error", user: "auth-error", loggedIn: false, passwordFocus: false},
1160+ {tag: "without password", user: "no-password", loggedIn: true, passwordFocus: false},
1161+ {tag: "with password", user: "has-password", loggedIn: false, passwordFocus: true},
1165+ function test_appLaunchDuringGreeter(data) {
1166+ setLightDMMockMode("full");
1167+ loadShell("tablet");
1169+ selectUser(data.user)
1171+ var greeter = findChild(shell, "greeter")
1172+ var app = ApplicationManager.startApplication("dialer-app")
1174+ confirmLoggedIn(data.loggedIn)
1176+ if (data.passwordFocus) {
1177+ var passwordInput = findChild(greeter, "passwordInput")
1178+ tryCompare(passwordInput, "focus", true)