@@ -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>
@@ -34,9 +34,10 @@ import Powerd 0.1
35import "../../qml"
35import "../../qml"
39− width: units.gu(60)
40+ width: units.gu(100) + controls.width
40 height: units.gu(71)
41 height: units.gu(71)
42 Component.onCompleted: {
43 Component.onCompleted: {
@@ -62,12 +63,37 @@ Item {
66− anchors.fill: parent
67+ anchors.left: root.left
68+ anchors.right: controls.left
69+ anchors.top: root.top
70+ anchors.bottom: root.bottom
68 id: shellLoader
72 id: shellLoader
69 focus: true
73 focus: true
75+ anchors.centerIn: parent
71 active: false
97 active: false
72 property bool itemDestroyed: false
98 property bool itemDestroyed: false
73 sourceComponent: Component {
99 sourceComponent: Component {
@@ -80,42 +106,56 @@ Item {
115+ anchors.top: root.top
116+ anchors.bottom: root.bottom
117+ anchors.right: root.right
120+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
121+ spacing: units.gu(1)
123+ anchors { left: parent.left; right: parent.right }
125+ text: "Show Greeter"
126+ activeFocusOnPress: false
128+ 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");
131+ var greeter = testCase.findChild(shellLoader.item, "greeter");
102− if (!greeter.shown) {
132+ if (!greeter.shown) {
103− LightDM.Greeter.showGreeter();
133+ LightDM.Greeter.showGreeter();
108− ListItem.ItemSelector {
138+ ListItem.ItemSelector {
109− anchors { left: parent.left; right: parent.right }
139+ anchors { left: parent.left; right: parent.right }
110− activeFocusOnPress: false
140+ activeFocusOnPress: false
111− text: "LightDM mock mode"
141+ text: "LightDM mock mode"
112− model: ["single", "single-passphrase", "single-pin"]
142+ model: ["single", "single-passphrase", "single-pin", "full"]
113− onSelectedIndexChanged: {
143+ onSelectedIndexChanged: {
114− shellLoader.active = false;
144+ shellLoader.active = false;
115− LightDM.Greeter.mockMode = model[selectedIndex];
145+ LightDM.Greeter.mockMode = model[selectedIndex];
116− LightDM.Users.mockMode = model[selectedIndex];
146+ LightDM.Users.mockMode = model[selectedIndex];
117− shellLoader.active = true;
147+ shellLoader.active = true;
150+ ListItem.ItemSelector {
151+ anchors { left: parent.left; right: parent.right }
152+ activeFocusOnPress: false
154+ model: ["phone", "tablet"]
155+ onSelectedIndexChanged: {
156+ shellLoader.active = false;
157+ shellLoader.state = model[selectedIndex];
158+ shellLoader.active = true;
@@ -186,20 +226,49 @@ Item {
186 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
226 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
188 function init() {
228 function init() {
189− tryCompare(shell, "enabled", true); // enabled by greeter when ready
229+ if (shellLoader.active) {
190− shell.indicatorProfile = "phone";
230+ // happens for the very first test function as shell
231+ // is loaded by default
192− swipeAwayGreeter();
235+ }
237+ function cleanup() {
238+ tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
242+ function loadShell(formFactor) {
243+ shellLoader.state = formFactor;
244+ shellLoader.active = true;
245+ tryCompare(shellLoader, "status", Loader.Ready);
246+ removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
247+ tryCompare(shell, "enabled", true); // enabled by greeter when ready
194 sessionSpy.target = findChild(shell, "greeter")
249 sessionSpy.target = findChild(shell, "greeter")
195 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
250 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
197 var launcher = findChild(shell, "launcher");
252 var launcher = findChild(shell, "launcher");
198 launcherShowDashHomeSpy.target = launcher;
253 launcherShowDashHomeSpy.target = launcher;
255+ waitForGreeterToStabilize();
201− function cleanup() {
258+ function waitForGreeterToStabilize() {
202− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
259+ var greeter = findChild(shell, "greeter");
262+ var loginList = findChild(greeter, "loginList");
263+ // Only present in WideView
265+ var userList = findChild(loginList, "userList");
267+ tryCompare(userList, "movingInternally", false);
271+ function tearDown() {
203 launcherShowDashHomeSpy.target = null;
272 launcherShowDashHomeSpy.target = null;
205 shellLoader.itemDestroyed = false;
274 shellLoader.itemDestroyed = false;
@@ -216,17 +285,17 @@ Item {
216 // Shell instance gets destroyed.
285 // Shell instance gets destroyed.
217 tryCompare(shellLoader, "itemDestroyed", true);
286 tryCompare(shellLoader, "itemDestroyed", true);
288+ setLightDMMockMode("single"); // back to the default value
290+ AccountsService.demoEdges = false;
219 // kill all (fake) running apps
292 // kill all (fake) running apps
220 killApps(ApplicationManager);
293 killApps(ApplicationManager);
222 unlockAllModemsSpy.clear()
295 unlockAllModemsSpy.clear()
223 LightDM.Greeter.authenticate(""); // reset greeter
296 LightDM.Greeter.authenticate(""); // reset greeter
225− // reload our test subject to get it in a fresh state once again
298+ sessionSpy.clear();
226− shellLoader.active = true;
228− tryCompare(shellLoader, "status", Loader.Ready);
229− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
232 function killApps() {
301 function killApps() {
@@ -238,6 +307,8 @@ Item {
240 function test_snapDecisionDismissalReturnsFocus() {
309 function test_snapDecisionDismissalReturnsFocus() {
241 var notifications = findChild(shell, "notificationList");
312 var notifications = findChild(shell, "notificationList");
242 var app = ApplicationManager.startApplication("camera-app");
313 var app = ApplicationManager.startApplication("camera-app");
243 var stage = findChild(shell, "stage")
314 var stage = findChild(shell, "stage")
@@ -296,19 +367,41 @@ Item {
296 mockNotificationsModel.append(n)
367 mockNotificationsModel.append(n)
299− function test_leftEdgeDrag_data() {
370+ function test_phoneLeftEdgeDrag_data() {
372+ {tag: "without launcher",
301− {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
373+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
374+ launcherHides: true, greeterShown: false},
376+ {tag: "with launcher",
302− {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
377+ revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
378+ launcherHides: true, greeterShown: false},
380+ {tag: "small swipe",
303− {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: false},
381+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
382+ launcherHides: false, greeterShown: false},
304− {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
385+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
386+ launcherHides: true, greeterShown: false},
388+ {tag: "small swipe with greeter",
305− {tag: "small swipe with greeter", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: true},
389+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
390+ launcherHides: false, greeterShown: true},
392+ {tag: "long swipe with greeter",
306− {tag: "long swipe with greeter", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: true},
393+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
394+ launcherHides: true, greeterShown: true},
396+ {tag: "swipe over dash",
307− {tag: "swipe over dash", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash", launcherHides: false, greeterShown: false},
397+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
398+ launcherHides: false, greeterShown: false},
311− function test_leftEdgeDrag(data) {
402+ function test_phoneLeftEdgeDrag(data) {
312 dragLauncherIntoView();
405 dragLauncherIntoView();
313 tapOnAppIconInLauncher();
406 tapOnAppIconInLauncher();
314 waitUntilApplicationWindowIsFullyVisible();
407 waitUntilApplicationWindowIsFullyVisible();
@@ -341,7 +434,32 @@ Item {
341 compare(animateTimer.nextState, "visible");
434 compare(animateTimer.nextState, "visible");
437+ function test_tabletLeftEdgeDrag_data() {
439+ {tag: "without password", user: "no-password", loggedIn: true, demo: false},
440+ {tag: "with password", user: "has-password", loggedIn: false, demo: false},
441+ {tag: "with demo", user: "has-password", loggedIn: true, demo: true},
445+ function test_tabletLeftEdgeDrag(data) {
446+ setLightDMMockMode("full");
447+ loadShell("tablet");
449+ selectUser(data.user)
451+ AccountsService.demoEdges = data.demo
452+ var tutorial = findChild(shell, "tutorial");
453+ tryCompare(tutorial, "running", data.demo);
455+ swipeFromLeftEdge(shell.width * 0.75)
456+ wait(500) // to give time to handle dash() signal from Launcher
457+ confirmLoggedIn(data.loggedIn)
344 function test_suspend() {
460 function test_suspend() {
345 var greeter = findChild(shell, "greeter");
463 var greeter = findChild(shell, "greeter");
347 // Launch an app from the launcher
465 // Launch an app from the launcher
@@ -401,6 +519,60 @@ Item {
401 waitForRendering(greeter);
519 waitForRendering(greeter);
522+ function selectUserAtIndex(i) {
523+ // We could be anywhere in list; find target index to know which direction
524+ var greeter = findChild(shell, "greeter")
525+ var userlist = findChild(greeter, "userList")
526+ if (userlist.currentIndex == i)
527+ keyClick(Qt.Key_Escape) // Reset state if we're not moving
528+ while (userlist.currentIndex != i) {
529+ var next = userlist.currentIndex + 1
530+ if (userlist.currentIndex > i) {
531+ next = userlist.currentIndex - 1
533+ tap(findChild(greeter, "username"+next));
534+ tryCompare(userlist, "currentIndex", next)
535+ tryCompare(userlist, "movingInternally", false)
539+ function selectUser(name) {
540+ // Find index of user with the right name
541+ for (var i = 0; i < LightDM.Users.count; i++) {
542+ if (LightDM.Users.data(i, LightDM.UserRoles.NameRole) == name) {
546+ if (i == LightDM.Users.count) {
547+ fail("Didn't find name")
550+ selectUserAtIndex(i)
554+ function clickPasswordInput(isButton) {
555+ var greeter = findChild(shell, "greeter")
556+ tryCompare(greeter, "fullyShown", true);
558+ var passwordMouseArea = findChild(shell, "passwordMouseArea")
559+ tryCompare(passwordMouseArea, "enabled", isButton)
561+ var passwordInput = findChild(shell, "passwordInput")
562+ mouseClick(passwordInput)
565+ function confirmLoggedIn(loggedIn) {
566+ var greeter = findChild(shell, "greeter");
567+ tryCompare(greeter, "shown", loggedIn ? false : true);
568+ verify(loggedIn ? sessionSpy.count > 0 : sessionSpy.count === 0);
571+ function setLightDMMockMode(mode) {
572+ LightDM.Greeter.mockMode = mode;
573+ LightDM.Users.mockMode = mode;
405 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
577 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
@@ -413,6 +585,8 @@ Item {
413 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
585 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
415 function test_minimizingAppTakesToDashApps() {
587 function test_minimizingAppTakesToDashApps() {
416 dragLauncherIntoView();
590 dragLauncherIntoView();
418 // Launch an app from the launcher
592 // Launch an app from the launcher
@@ -433,6 +607,8 @@ Item {
435 function test_showInputMethod() {
609 function test_showInputMethod() {
436 var item = findChild(shell, "inputMethod");
612 var item = findChild(shell, "inputMethod");
437 var surface = SurfaceManager.inputMethodSurface();
613 var surface = SurfaceManager.inputMethodSurface();
@@ -471,6 +647,8 @@ Item {
473 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
649 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
474 var app = ApplicationManager.startApplication("dialer-app");
652 var app = ApplicationManager.startApplication("dialer-app");
475 waitUntilAppWindowIsFullyLoaded(app);
653 waitUntilAppWindowIsFullyLoaded(app);
@@ -501,28 +679,26 @@ Item {
501 tryCompare(app.session.surface, "activeFocus", true);
679 tryCompare(app.session.surface, "activeFocus", true);
682+ function test_launchedAppHasActiveFocus_data() {
684+ {tag:"phone", formFactor:"phone"},
685+ {tag:"tablet", formFactor:"tablet"},
504− function test_launchedAppHasActiveFocus() {
689+ function test_launchedAppHasActiveFocus(data) {
690+ loadShell(data.formFactor);
505− var dialerApp = ApplicationManager.startApplication("dialer-app");
693+ var dialerApp = ApplicationManager.startApplication("webbrowser-app");
506 verify(dialerApp);
694 verify(dialerApp);
507− waitUntilAppSurfaceShowsUp("dialer-app")
695+ waitUntilAppSurfaceShowsUp("webbrowser-app")
509 verify(dialerApp.session.surface);
697 verify(dialerApp.session.surface);
511 tryCompare(dialerApp.session.surface, "activeFocus", true);
699 tryCompare(dialerApp.session.surface, "activeFocus", true);
514− // Wait for the whole UI to settle down
515− function waitForUIToSettle() {
516− var launcher = findChild(shell, "launcherPanel")
517− tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
518− if (launcher.x === 0) {
521− tryCompare(launcher, "x", -launcher.width)
523− waitForRendering(shell)
526 function waitUntilAppSurfaceShowsUp(appId) {
702 function waitUntilAppSurfaceShowsUp(appId) {
527 var appWindow = findChild(shell, "appWindow_" + appId);
703 var appWindow = findChild(shell, "appWindow_" + appId);
528 verify(appWindow);
704 verify(appWindow);
@@ -615,6 +791,8 @@ Item {
617 function test_greeterDoesNotChangeIndicatorProfile() {
793 function test_greeterDoesNotChangeIndicatorProfile() {
618 var panel = findChild(shell, "panel");
796 var panel = findChild(shell, "panel");
619 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
797 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
@@ -626,6 +804,8 @@ Item {
628 function test_shellProfileChangesReachIndicators() {
806 function test_shellProfileChangesReachIndicators() {
629 var panel = findChild(shell, "panel");
809 var panel = findChild(shell, "panel");
631 shell.indicatorProfile = "test1";
811 shell.indicatorProfile = "test1";
@@ -642,6 +822,8 @@ Item {
644 function test_focusRequestedHidesGreeter() {
824 function test_focusRequestedHidesGreeter() {
645 var greeter = findChild(shell, "greeter");
827 var greeter = findChild(shell, "greeter");
647 var app = ApplicationManager.startApplication("dialer-app");
829 var app = ApplicationManager.startApplication("dialer-app");
@@ -662,6 +844,8 @@ Item {
664 function test_focusRequestedHidesIndicators() {
846 function test_focusRequestedHidesIndicators() {
665 var indicators = findChild(shell, "indicators");
849 var indicators = findChild(shell, "indicators");
667 showIndicators();
851 showIndicators();
@@ -674,6 +858,8 @@ Item {
676 function test_showAndHideGreeterDBusCalls() {
860 function test_showAndHideGreeterDBusCalls() {
677 var greeter = findChild(shell, "greeter")
863 var greeter = findChild(shell, "greeter")
678 tryCompare(greeter, "shown", false)
864 tryCompare(greeter, "shown", false)
679 waitForRendering(greeter);
865 waitForRendering(greeter);
@@ -685,6 +871,9 @@ Item {
687 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
873 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
688 sessionSpy.clear();
877 sessionSpy.clear();
689 verify(sessionSpy.valid);
878 verify(sessionSpy.valid);
@@ -694,6 +883,8 @@ Item {
696 function test_fullscreen() {
885 function test_fullscreen() {
697 var panel = findChild(shell, "panel");
888 var panel = findChild(shell, "panel");
698 compare(panel.fullscreenMode, false);
889 compare(panel.fullscreenMode, false);
699 ApplicationManager.startApplication("camera-app");
890 ApplicationManager.startApplication("camera-app");
@@ -707,6 +898,8 @@ Item {
709 function test_leftEdgeDragFullscreen() {
900 function test_leftEdgeDragFullscreen() {
710 var panel = findChild(shell, "panel");
903 var panel = findChild(shell, "panel");
711 tryCompare(panel, "fullscreenMode", false)
904 tryCompare(panel, "fullscreenMode", false)
@@ -728,6 +921,8 @@ Item {
730 function test_unlockedProperties() {
923 function test_unlockedProperties() {
731 // Confirm that various properties have the correct values when unlocked
926 // Confirm that various properties have the correct values when unlocked
732 var greeter = findChild(shell, "greeter");
927 var greeter = findChild(shell, "greeter");
733 tryCompare(greeter, "locked", false);
928 tryCompare(greeter, "locked", false);
@@ -740,10 +935,14 @@ Item {
742 function test_unlockAllModemsOnBoot() {
937 function test_unlockAllModemsOnBoot() {
743 tryCompare(unlockAllModemsSpy, "count", 1)
940 tryCompare(unlockAllModemsSpy, "count", 1)
746 function test_tapOnRightEdgeReachesApplicationSurface() {
943 function test_tapOnRightEdgeReachesApplicationSurface() {
747 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
946 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
748 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
947 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
749 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
948 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -766,6 +965,8 @@ Item {
766 by the right-edge drag area)
965 by the right-edge drag area)
768 function test_rightEdgeDragDoesNotReachApplicationSurface() {
967 function test_rightEdgeDragDoesNotReachApplicationSurface() {
769 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
970 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
770 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
971 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
771 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
972 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -810,6 +1011,8 @@ Item {
812 function test_tapUbuntuIconInLauncherOverAppSpread() {
1013 function test_tapUbuntuIconInLauncherOverAppSpread() {
1014+ loadShell("phone");
1015+ swipeAwayGreeter();
814 waitUntilFocusedApplicationIsShowingItsSurface();
1017 waitUntilFocusedApplicationIsShowingItsSurface();
@@ -856,19 +1059,75 @@ Item {
856 function test_background_data() {
1059 function test_background_data() {
857 return [
1060 return [
858 {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>")},
1061 {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>")},
859− {tag: "empty", accounts: "", gsettings: "", output: shell.defaultBackground},
1062+ {tag: "empty", accounts: "", gsettings: "", output: "defaultBackground"},
860 {tag: "as-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: "", output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
1063 {tag: "as-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: "", output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
861 {tag: "gs-specified", accounts: "", gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
1064 {tag: "gs-specified", accounts: "", gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
862 {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")},
1065 {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")},
863 {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")},
1066 {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")},
864− {tag: "invalid-both", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"), output: shell.defaultBackground},
1067+ {tag: "invalid-both", accounts: Qt.resolvedUrl("../data/unity/backgrounds/nope.png"), gsettings: Qt.resolvedUrl("../data/unity/backgrounds/stillnope.png"), output: "defaultBackground"},
867 function test_background(data) {
1070 function test_background(data) {
1071+ loadShell("phone");
1072+ swipeAwayGreeter();
868 AccountsService.backgroundFile = data.accounts;
1073 AccountsService.backgroundFile = data.accounts;
869 var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
1074 var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
870 backgroundSettings.pictureUri = data.gsettings;
1075 backgroundSettings.pictureUri = data.gsettings;
1077+ if (data.output === "defaultBackground") {
1078+ tryCompare(shell, "background", shell.defaultBackground);
871− tryCompare(shell, "background", data.output);
1080+ tryCompare(shell, "background", data.output);
1084+ function test_tabletLogin_data() {
1086+ {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1087+ {tag: "with password", user: "has-password", loggedIn: true, password: "password"},
1088+ {tag: "without password", user: "no-password", loggedIn: true, password: ""},
1092+ function test_tabletLogin(data) {
1093+ setLightDMMockMode("full");
1094+ loadShell("tablet");
1096+ selectUser(data.user);
1098+ clickPasswordInput(data.password === "" /* isButton */);
1100+ if (data.password !== "") {
1101+ typeString(data.password);
1102+ keyClick(Qt.Key_Enter);
1105+ confirmLoggedIn(data.loggedIn);
1108+ function test_appLaunchDuringGreeter_data() {
1110+ {tag: "auth error", user: "auth-error", loggedIn: false, passwordFocus: false},
1111+ {tag: "without password", user: "no-password", loggedIn: true, passwordFocus: false},
1112+ {tag: "with password", user: "has-password", loggedIn: false, passwordFocus: true},
1116+ function test_appLaunchDuringGreeter(data) {
1117+ setLightDMMockMode("full");
1118+ loadShell("tablet");
1120+ selectUser(data.user)
1122+ var greeter = findChild(shell, "greeter")
1123+ var app = ApplicationManager.startApplication("dialer-app")
1125+ confirmLoggedIn(data.loggedIn)
1127+ if (data.passwordFocus) {
1128+ var passwordInput = findChild(greeter, "passwordInput")
1129+ tryCompare(passwordInput, "focus", true)