@@ -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,10 +226,25 @@ 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");
@@ -198,8 +253,7 @@ Item {
198 launcherShowDashHomeSpy.target = launcher;
253 launcherShowDashHomeSpy.target = launcher;
201− function cleanup() {
256+ function tearDown() {
202− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
203 launcherShowDashHomeSpy.target = null;
257 launcherShowDashHomeSpy.target = null;
205 shellLoader.itemDestroyed = false;
259 shellLoader.itemDestroyed = false;
@@ -216,17 +270,17 @@ Item {
216 // Shell instance gets destroyed.
270 // Shell instance gets destroyed.
217 tryCompare(shellLoader, "itemDestroyed", true);
271 tryCompare(shellLoader, "itemDestroyed", true);
273+ setLightDMMockMode("single"); // back to the default value
275+ AccountsService.demoEdges = false;
219 // kill all (fake) running apps
277 // kill all (fake) running apps
220 killApps(ApplicationManager);
278 killApps(ApplicationManager);
222 unlockAllModemsSpy.clear()
280 unlockAllModemsSpy.clear()
223 LightDM.Greeter.authenticate(""); // reset greeter
281 LightDM.Greeter.authenticate(""); // reset greeter
225− // reload our test subject to get it in a fresh state once again
283+ sessionSpy.clear();
226− shellLoader.active = true;
228− tryCompare(shellLoader, "status", Loader.Ready);
229− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
232 function killApps() {
286 function killApps() {
@@ -238,6 +292,8 @@ Item {
240 function test_snapDecisionDismissalReturnsFocus() {
294 function test_snapDecisionDismissalReturnsFocus() {
241 var notifications = findChild(shell, "notificationList");
297 var notifications = findChild(shell, "notificationList");
242 var app = ApplicationManager.startApplication("camera-app");
298 var app = ApplicationManager.startApplication("camera-app");
243 var stage = findChild(shell, "stage")
299 var stage = findChild(shell, "stage")
@@ -296,19 +352,41 @@ Item {
296 mockNotificationsModel.append(n)
352 mockNotificationsModel.append(n)
299− function test_leftEdgeDrag_data() {
355+ function test_phoneLeftEdgeDrag_data() {
357+ {tag: "without launcher",
301− {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
358+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
359+ launcherHides: true, greeterShown: false},
361+ {tag: "with launcher",
302− {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
362+ revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
363+ launcherHides: true, greeterShown: false},
365+ {tag: "small swipe",
303− {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: false},
366+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
367+ launcherHides: false, greeterShown: false},
304− {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
370+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
371+ launcherHides: true, greeterShown: false},
373+ {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},
374+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
375+ launcherHides: false, greeterShown: true},
377+ {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},
378+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
379+ launcherHides: true, greeterShown: true},
381+ {tag: "swipe over dash",
307− {tag: "swipe over dash", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash", launcherHides: false, greeterShown: false},
382+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
383+ launcherHides: false, greeterShown: false},
311− function test_leftEdgeDrag(data) {
387+ function test_phoneLeftEdgeDrag(data) {
312 dragLauncherIntoView();
390 dragLauncherIntoView();
313 tapOnAppIconInLauncher();
391 tapOnAppIconInLauncher();
314 waitUntilApplicationWindowIsFullyVisible();
392 waitUntilApplicationWindowIsFullyVisible();
@@ -341,7 +419,32 @@ Item {
341 compare(animateTimer.nextState, "visible");
419 compare(animateTimer.nextState, "visible");
422+ function test_tabletLeftEdgeDrag_data() {
424+ {tag: "without password", user: "no-password", loggedIn: true, demo: false},
425+ {tag: "with password", user: "has-password", loggedIn: false, demo: false},
426+ {tag: "with demo", user: "has-password", loggedIn: true, demo: true},
430+ function test_tabletLeftEdgeDrag(data) {
431+ setLightDMMockMode("full");
432+ loadShell("tablet");
434+ selectUser(data.user)
436+ AccountsService.demoEdges = data.demo
437+ var tutorial = findChild(shell, "tutorial");
438+ tryCompare(tutorial, "running", data.demo);
440+ swipeFromLeftEdge(shell.width * 0.75)
441+ wait(500) // to give time to handle dash() signal from Launcher
442+ confirmLoggedIn(data.loggedIn)
344 function test_suspend() {
445 function test_suspend() {
345 var greeter = findChild(shell, "greeter");
448 var greeter = findChild(shell, "greeter");
347 // Launch an app from the launcher
450 // Launch an app from the launcher
@@ -401,6 +504,60 @@ Item {
401 waitForRendering(greeter);
504 waitForRendering(greeter);
507+ function selectUserAtIndex(i) {
508+ // We could be anywhere in list; find target index to know which direction
509+ var greeter = findChild(shell, "greeter")
510+ var userlist = findChild(greeter, "userList")
511+ if (userlist.currentIndex == i)
512+ keyClick(Qt.Key_Escape) // Reset state if we're not moving
513+ while (userlist.currentIndex != i) {
514+ var next = userlist.currentIndex + 1
515+ if (userlist.currentIndex > i) {
516+ next = userlist.currentIndex - 1
518+ tap(findChild(greeter, "username"+next));
519+ tryCompare(userlist, "currentIndex", next)
520+ tryCompare(userlist, "movingInternally", false)
524+ function selectUser(name) {
525+ // Find index of user with the right name
526+ for (var i = 0; i < LightDM.Users.count; i++) {
527+ if (LightDM.Users.data(i, LightDM.UserRoles.NameRole) == name) {
531+ if (i == LightDM.Users.count) {
532+ fail("Didn't find name")
535+ selectUserAtIndex(i)
539+ function clickPasswordInput(isButton) {
540+ var greeter = findChild(shell, "greeter")
541+ tryCompare(greeter, "fullyShown", true);
543+ var passwordMouseArea = findChild(shell, "passwordMouseArea")
544+ tryCompare(passwordMouseArea, "enabled", isButton)
546+ var passwordInput = findChild(shell, "passwordInput")
547+ mouseClick(passwordInput)
550+ function confirmLoggedIn(loggedIn) {
551+ var greeter = findChild(shell, "greeter");
552+ tryCompare(greeter, "shown", loggedIn ? false : true);
553+ verify(loggedIn ? sessionSpy.count > 0 : sessionSpy.count === 0);
556+ function setLightDMMockMode(mode) {
557+ LightDM.Greeter.mockMode = mode;
558+ LightDM.Users.mockMode = mode;
405 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
562 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
@@ -413,6 +570,8 @@ Item {
413 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
570 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
415 function test_minimizingAppTakesToDashApps() {
572 function test_minimizingAppTakesToDashApps() {
416 dragLauncherIntoView();
575 dragLauncherIntoView();
418 // Launch an app from the launcher
577 // Launch an app from the launcher
@@ -433,6 +592,8 @@ Item {
435 function test_showInputMethod() {
594 function test_showInputMethod() {
436 var item = findChild(shell, "inputMethod");
597 var item = findChild(shell, "inputMethod");
437 var surface = SurfaceManager.inputMethodSurface();
598 var surface = SurfaceManager.inputMethodSurface();
@@ -471,6 +632,8 @@ Item {
473 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
634 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
474 var app = ApplicationManager.startApplication("dialer-app");
637 var app = ApplicationManager.startApplication("dialer-app");
475 waitUntilAppWindowIsFullyLoaded(app);
638 waitUntilAppWindowIsFullyLoaded(app);
@@ -501,10 +664,19 @@ Item {
501 tryCompare(app.session.surface, "activeFocus", true);
664 tryCompare(app.session.surface, "activeFocus", true);
667+ function test_launchedAppHasActiveFocus_data() {
669+ {tag:"phone", formFactor:"phone"},
670+ {tag:"tablet", formFactor:"tablet"},
504− function test_launchedAppHasActiveFocus() {
674+ function test_launchedAppHasActiveFocus(data) {
675+ loadShell(data.formFactor);
505− var dialerApp = ApplicationManager.startApplication("dialer-app");
677+ var dialerApp = ApplicationManager.startApplication("webbrowser-app");
506 verify(dialerApp);
678 verify(dialerApp);
507− waitUntilAppSurfaceShowsUp("dialer-app")
679+ waitUntilAppSurfaceShowsUp("webbrowser-app")
509 verify(dialerApp.session.surface);
681 verify(dialerApp.session.surface);
@@ -615,6 +787,8 @@ Item {
617 function test_greeterDoesNotChangeIndicatorProfile() {
789 function test_greeterDoesNotChangeIndicatorProfile() {
618 var panel = findChild(shell, "panel");
792 var panel = findChild(shell, "panel");
619 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
793 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
@@ -626,6 +800,8 @@ Item {
628 function test_shellProfileChangesReachIndicators() {
802 function test_shellProfileChangesReachIndicators() {
629 var panel = findChild(shell, "panel");
805 var panel = findChild(shell, "panel");
631 shell.indicatorProfile = "test1";
807 shell.indicatorProfile = "test1";
@@ -642,6 +818,8 @@ Item {
644 function test_focusRequestedHidesGreeter() {
820 function test_focusRequestedHidesGreeter() {
645 var greeter = findChild(shell, "greeter");
823 var greeter = findChild(shell, "greeter");
647 var app = ApplicationManager.startApplication("dialer-app");
825 var app = ApplicationManager.startApplication("dialer-app");
@@ -662,6 +840,8 @@ Item {
664 function test_focusRequestedHidesIndicators() {
842 function test_focusRequestedHidesIndicators() {
665 var indicators = findChild(shell, "indicators");
845 var indicators = findChild(shell, "indicators");
667 showIndicators();
847 showIndicators();
@@ -674,6 +854,8 @@ Item {
676 function test_showAndHideGreeterDBusCalls() {
856 function test_showAndHideGreeterDBusCalls() {
677 var greeter = findChild(shell, "greeter")
859 var greeter = findChild(shell, "greeter")
678 tryCompare(greeter, "shown", false)
860 tryCompare(greeter, "shown", false)
679 waitForRendering(greeter);
861 waitForRendering(greeter);
@@ -685,6 +867,9 @@ Item {
687 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
869 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
688 sessionSpy.clear();
873 sessionSpy.clear();
689 verify(sessionSpy.valid);
874 verify(sessionSpy.valid);
@@ -694,6 +879,8 @@ Item {
696 function test_fullscreen() {
881 function test_fullscreen() {
697 var panel = findChild(shell, "panel");
884 var panel = findChild(shell, "panel");
698 compare(panel.fullscreenMode, false);
885 compare(panel.fullscreenMode, false);
699 ApplicationManager.startApplication("camera-app");
886 ApplicationManager.startApplication("camera-app");
@@ -707,6 +894,8 @@ Item {
709 function test_leftEdgeDragFullscreen() {
896 function test_leftEdgeDragFullscreen() {
710 var panel = findChild(shell, "panel");
899 var panel = findChild(shell, "panel");
711 tryCompare(panel, "fullscreenMode", false)
900 tryCompare(panel, "fullscreenMode", false)
@@ -728,6 +917,8 @@ Item {
730 function test_unlockedProperties() {
919 function test_unlockedProperties() {
731 // Confirm that various properties have the correct values when unlocked
922 // Confirm that various properties have the correct values when unlocked
732 var greeter = findChild(shell, "greeter");
923 var greeter = findChild(shell, "greeter");
733 tryCompare(greeter, "locked", false);
924 tryCompare(greeter, "locked", false);
@@ -740,10 +931,14 @@ Item {
742 function test_unlockAllModemsOnBoot() {
933 function test_unlockAllModemsOnBoot() {
743 tryCompare(unlockAllModemsSpy, "count", 1)
936 tryCompare(unlockAllModemsSpy, "count", 1)
746 function test_tapOnRightEdgeReachesApplicationSurface() {
939 function test_tapOnRightEdgeReachesApplicationSurface() {
747 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
942 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
748 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
943 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
749 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
944 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -766,6 +961,8 @@ Item {
766 by the right-edge drag area)
961 by the right-edge drag area)
768 function test_rightEdgeDragDoesNotReachApplicationSurface() {
963 function test_rightEdgeDragDoesNotReachApplicationSurface() {
769 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
966 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
770 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
967 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
771 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
968 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -810,6 +1007,8 @@ Item {
812 function test_tapUbuntuIconInLauncherOverAppSpread() {
1009 function test_tapUbuntuIconInLauncherOverAppSpread() {
1010+ loadShell("phone");
1011+ swipeAwayGreeter();
814 waitUntilFocusedApplicationIsShowingItsSurface();
1013 waitUntilFocusedApplicationIsShowingItsSurface();
@@ -856,19 +1055,75 @@ Item {
856 function test_background_data() {
1055 function test_background_data() {
857 return [
1056 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>")},
1057 {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},
1058+ {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")},
1059 {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")},
1060 {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")},
1061 {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")},
1062 {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},
1063+ {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) {
1066 function test_background(data) {
1067+ loadShell("phone");
1068+ swipeAwayGreeter();
868 AccountsService.backgroundFile = data.accounts;
1069 AccountsService.backgroundFile = data.accounts;
869 var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
1070 var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
870 backgroundSettings.pictureUri = data.gsettings;
1071 backgroundSettings.pictureUri = data.gsettings;
1073+ if (data.output === "defaultBackground") {
1074+ tryCompare(shell, "background", shell.defaultBackground);
871− tryCompare(shell, "background", data.output);
1076+ tryCompare(shell, "background", data.output);
1080+ function test_tabletLogin_data() {
1082+ {tag: "auth error", user: "auth-error", loggedIn: false, password: ""},
1083+ {tag: "with password", user: "has-password", loggedIn: true, password: "password"},
1084+ {tag: "without password", user: "no-password", loggedIn: true, password: ""},
1088+ function test_tabletLogin(data) {
1089+ setLightDMMockMode("full");
1090+ loadShell("tablet");
1092+ selectUser(data.user);
1094+ clickPasswordInput(data.password === "" /* isButton */);
1096+ if (data.password !== "") {
1097+ typeString(data.password);
1098+ keyClick(Qt.Key_Enter);
1101+ confirmLoggedIn(data.loggedIn);
1104+ function test_appLaunchDuringGreeter_data() {
1106+ {tag: "auth error", user: "auth-error", loggedIn: false, passwordFocus: false},
1107+ {tag: "without password", user: "no-password", loggedIn: true, passwordFocus: false},
1108+ {tag: "with password", user: "has-password", loggedIn: false, passwordFocus: true},
1112+ function test_appLaunchDuringGreeter(data) {
1113+ setLightDMMockMode("full");
1114+ loadShell("tablet");
1116+ selectUser(data.user)
1118+ var greeter = findChild(shell, "greeter")
1119+ var app = ApplicationManager.startApplication("dialer-app")
1121+ confirmLoggedIn(data.loggedIn)
1123+ if (data.passwordFocus) {
1124+ var passwordInput = findChild(greeter, "passwordInput")
1125+ tryCompare(passwordInput, "focus", true)