@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013-2014 Canonical, Ltd.
2+ * Copyright (C) 2013-2015 Canonical, Ltd.
33 *
44 * Authors:
55 * Daniel d'Andrada <daniel.dandrada@canonical.com>
@@ -34,9 +34,10 @@ import Powerd 0.1
3434
3535import "../../qml"
3636
37−Item {
37+Rectangle {
3838 id: root
39− width: units.gu(60)
39+ color: "grey"
40+ width: units.gu(100) + controls.width
4041 height: units.gu(71)
4142
4243 Component.onCompleted: {
@@ -62,12 +63,37 @@ Item {
6263 }
6364 }
6465
65− Row {
66− anchors.fill: parent
66+ Item {
67+ anchors.left: root.left
68+ anchors.right: controls.left
69+ anchors.top: root.top
70+ anchors.bottom: root.bottom
6771 Loader {
6872 id: shellLoader
6973 focus: true
7074
75+ anchors.centerIn: parent
76+
77+ state: "phone"
78+ states: [
79+ State {
80+ name: "phone"
81+ PropertyChanges {
82+ target: shellLoader
83+ width: units.gu(40)
84+ height: units.gu(71)
85+ }
86+ },
87+ State {
88+ name: "tablet"
89+ PropertyChanges {
90+ target: shellLoader
91+ width: units.gu(100)
92+ height: units.gu(71)
93+ }
94+ }
95+ ]
96+
7197 active: false
7298 property bool itemDestroyed: false
7399 sourceComponent: Component {
@@ -80,42 +106,56 @@ Item {
80106 }
81107 }
82108 }
109+ }
110+
111+ Rectangle {
112+ id: controls
113+ color: "darkgrey"
114+ width: units.gu(30)
115+ anchors.top: root.top
116+ anchors.bottom: root.bottom
117+ anchors.right: root.right
118+
119+ Column {
120+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
121+ spacing: units.gu(1)
122+ Row {
123+ anchors { left: parent.left; right: parent.right }
124+ Button {
125+ text: "Show Greeter"
126+ activeFocusOnPress: false
127+ onClicked: {
128+ if (shellLoader.status !== Loader.Ready)
129+ return;
83130
84− Rectangle {
85− color: "darkgrey"
86− width: units.gu(30)
87− height: shellLoader.height
88−
89− Column {
90− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
91− spacing: units.gu(1)
92− Row {
93− anchors { left: parent.left; right: parent.right }
94− Button {
95− text: "Show Greeter"
96− activeFocusOnPress: false
97− onClicked: {
98− if (shellLoader.status !== Loader.Ready)
99− return;
100−
101− var greeter = testCase.findChild(shellLoader.item, "greeter");
102− if (!greeter.shown) {
103− LightDM.Greeter.showGreeter();
104− }
131+ var greeter = testCase.findChild(shellLoader.item, "greeter");
132+ if (!greeter.shown) {
133+ LightDM.Greeter.showGreeter();
105134 }
106135 }
107136 }
108− ListItem.ItemSelector {
109− anchors { left: parent.left; right: parent.right }
110− activeFocusOnPress: false
111− text: "LightDM mock mode"
112− model: ["single", "single-passphrase", "single-pin"]
113− onSelectedIndexChanged: {
114− shellLoader.active = false;
115− LightDM.Greeter.mockMode = model[selectedIndex];
116− LightDM.Users.mockMode = model[selectedIndex];
117− shellLoader.active = true;
118− }
137+ }
138+ ListItem.ItemSelector {
139+ anchors { left: parent.left; right: parent.right }
140+ activeFocusOnPress: false
141+ text: "LightDM mock mode"
142+ model: ["single", "single-passphrase", "single-pin", "full"]
143+ onSelectedIndexChanged: {
144+ shellLoader.active = false;
145+ LightDM.Greeter.mockMode = model[selectedIndex];
146+ LightDM.Users.mockMode = model[selectedIndex];
147+ shellLoader.active = true;
148+ }
149+ }
150+ ListItem.ItemSelector {
151+ anchors { left: parent.left; right: parent.right }
152+ activeFocusOnPress: false
153+ text: "Size"
154+ model: ["phone", "tablet"]
155+ onSelectedIndexChanged: {
156+ shellLoader.active = false;
157+ shellLoader.state = model[selectedIndex];
158+ shellLoader.active = true;
119159 }
120160 }
121161 }
@@ -186,20 +226,49 @@ Item {
186226 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
187227
188228 function init() {
189− tryCompare(shell, "enabled", true); // enabled by greeter when ready
190− shell.indicatorProfile = "phone";
229+ if (shellLoader.active) {
230+ // happens for the very first test function as shell
231+ // is loaded by default
232+ tearDown();
233+ }
191234
192− swipeAwayGreeter();
235+ }
236+
237+ function cleanup() {
238+ tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
239+ tearDown();
240+ }
241+
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
193248
194249 sessionSpy.target = findChild(shell, "greeter")
195250 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
196251
197252 var launcher = findChild(shell, "launcher");
198253 launcherShowDashHomeSpy.target = launcher;
254+
255+ waitForGreeterToStabilize();
199256 }
200257
201− function cleanup() {
202− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
258+ function waitForGreeterToStabilize() {
259+ var greeter = findChild(shell, "greeter");
260+ verify(greeter);
261+
262+ var loginList = findChild(greeter, "loginList");
263+ // Only present in WideView
264+ if (loginList) {
265+ var userList = findChild(loginList, "userList");
266+ verify(userList);
267+ tryCompare(userList, "movingInternally", false);
268+ }
269+ }
270+
271+ function tearDown() {
203272 launcherShowDashHomeSpy.target = null;
204273
205274 shellLoader.itemDestroyed = false;
@@ -216,17 +285,17 @@ Item {
216285 // Shell instance gets destroyed.
217286 tryCompare(shellLoader, "itemDestroyed", true);
218287
288+ setLightDMMockMode("single"); // back to the default value
289+
290+ AccountsService.demoEdges = false;
291+
219292 // kill all (fake) running apps
220293 killApps(ApplicationManager);
221294
222295 unlockAllModemsSpy.clear()
223296 LightDM.Greeter.authenticate(""); // reset greeter
224297
225− // reload our test subject to get it in a fresh state once again
226− shellLoader.active = true;
227−
228− tryCompare(shellLoader, "status", Loader.Ready);
229− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
298+ sessionSpy.clear();
230299 }
231300
232301 function killApps() {
@@ -238,6 +307,8 @@ Item {
238307 }
239308
240309 function test_snapDecisionDismissalReturnsFocus() {
310+ loadShell("phone");
311+ swipeAwayGreeter();
241312 var notifications = findChild(shell, "notificationList");
242313 var app = ApplicationManager.startApplication("camera-app");
243314 var stage = findChild(shell, "stage")
@@ -296,19 +367,41 @@ Item {
296367 mockNotificationsModel.append(n)
297368 }
298369
299− function test_leftEdgeDrag_data() {
370+ function test_phoneLeftEdgeDrag_data() {
300371 return [
301− {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
302− {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
303− {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: false},
304− {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: false},
305− {tag: "small swipe with greeter", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false, greeterShown: true},
306− {tag: "long swipe with greeter", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true, greeterShown: true},
307− {tag: "swipe over dash", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash", launcherHides: false, greeterShown: false},
372+ {tag: "without launcher",
373+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
374+ launcherHides: true, greeterShown: false},
375+
376+ {tag: "with launcher",
377+ revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
378+ launcherHides: true, greeterShown: false},
379+
380+ {tag: "small swipe",
381+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
382+ launcherHides: false, greeterShown: false},
383+
384+ {tag: "long swipe",
385+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
386+ launcherHides: true, greeterShown: false},
387+
388+ {tag: "small swipe with greeter",
389+ revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
390+ launcherHides: false, greeterShown: true},
391+
392+ {tag: "long swipe with greeter",
393+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
394+ launcherHides: true, greeterShown: true},
395+
396+ {tag: "swipe over dash",
397+ revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
398+ launcherHides: false, greeterShown: false},
308399 ];
309400 }
310401
311− function test_leftEdgeDrag(data) {
402+ function test_phoneLeftEdgeDrag(data) {
403+ loadShell("phone");
404+ swipeAwayGreeter();
312405 dragLauncherIntoView();
313406 tapOnAppIconInLauncher();
314407 waitUntilApplicationWindowIsFullyVisible();
@@ -341,7 +434,32 @@ Item {
341434 compare(animateTimer.nextState, "visible");
342435 }
343436
437+ function test_tabletLeftEdgeDrag_data() {
438+ return [
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},
442+ ]
443+ }
444+
445+ function test_tabletLeftEdgeDrag(data) {
446+ setLightDMMockMode("full");
447+ loadShell("tablet");
448+
449+ selectUser(data.user)
450+
451+ AccountsService.demoEdges = data.demo
452+ var tutorial = findChild(shell, "tutorial");
453+ tryCompare(tutorial, "running", data.demo);
454+
455+ swipeFromLeftEdge(shell.width * 0.75)
456+ wait(500) // to give time to handle dash() signal from Launcher
457+ confirmLoggedIn(data.loggedIn)
458+ }
459+
344460 function test_suspend() {
461+ loadShell("phone");
462+ swipeAwayGreeter();
345463 var greeter = findChild(shell, "greeter");
346464
347465 // Launch an app from the launcher
@@ -401,6 +519,60 @@ Item {
401519 waitForRendering(greeter);
402520 }
403521
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
532+ }
533+ tap(findChild(greeter, "username"+next));
534+ tryCompare(userlist, "currentIndex", next)
535+ tryCompare(userlist, "movingInternally", false)
536+ }
537+ }
538+
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) {
543+ break
544+ }
545+ }
546+ if (i == LightDM.Users.count) {
547+ fail("Didn't find name")
548+ return -1
549+ }
550+ selectUserAtIndex(i)
551+ return i
552+ }
553+
554+ function clickPasswordInput(isButton) {
555+ var greeter = findChild(shell, "greeter")
556+ tryCompare(greeter, "fullyShown", true);
557+
558+ var passwordMouseArea = findChild(shell, "passwordMouseArea")
559+ tryCompare(passwordMouseArea, "enabled", isButton)
560+
561+ var passwordInput = findChild(shell, "passwordInput")
562+ mouseClick(passwordInput)
563+ }
564+
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);
569+ }
570+
571+ function setLightDMMockMode(mode) {
572+ LightDM.Greeter.mockMode = mode;
573+ LightDM.Users.mockMode = mode;
574+ }
575+
404576 /*
405577 Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
406578
@@ -413,6 +585,8 @@ Item {
413585 - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
414586 */
415587 function test_minimizingAppTakesToDashApps() {
588+ loadShell("phone");
589+ swipeAwayGreeter();
416590 dragLauncherIntoView();
417591
418592 // Launch an app from the launcher
@@ -433,6 +607,8 @@ Item {
433607 }
434608
435609 function test_showInputMethod() {
610+ loadShell("phone");
611+ swipeAwayGreeter();
436612 var item = findChild(shell, "inputMethod");
437613 var surface = SurfaceManager.inputMethodSurface();
438614
@@ -471,6 +647,8 @@ Item {
471647 }
472648
473649 function test_surfaceLosesActiveFocusWhilePanelIsOpen() {
650+ loadShell("phone");
651+ swipeAwayGreeter();
474652 var app = ApplicationManager.startApplication("dialer-app");
475653 waitUntilAppWindowIsFullyLoaded(app);
476654
@@ -501,28 +679,26 @@ Item {
501679 tryCompare(app.session.surface, "activeFocus", true);
502680 }
503681
504− function test_launchedAppHasActiveFocus() {
505− var dialerApp = ApplicationManager.startApplication("dialer-app");
682+ function test_launchedAppHasActiveFocus_data() {
683+ return [
684+ {tag:"phone", formFactor:"phone"},
685+ {tag:"tablet", formFactor:"tablet"},
686+ ];
687+ }
688+
689+ function test_launchedAppHasActiveFocus(data) {
690+ loadShell(data.formFactor);
691+ swipeAwayGreeter();
692+
693+ var dialerApp = ApplicationManager.startApplication("webbrowser-app");
506694 verify(dialerApp);
507− waitUntilAppSurfaceShowsUp("dialer-app")
695+ waitUntilAppSurfaceShowsUp("webbrowser-app")
508696
509697 verify(dialerApp.session.surface);
510698
511699 tryCompare(dialerApp.session.surface, "activeFocus", true);
512700 }
513701
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) {
519− mouseClick(shell)
520− }
521− tryCompare(launcher, "x", -launcher.width)
522−
523− waitForRendering(shell)
524− }
525−
526702 function waitUntilAppSurfaceShowsUp(appId) {
527703 var appWindow = findChild(shell, "appWindow_" + appId);
528704 verify(appWindow);
@@ -615,6 +791,8 @@ Item {
615791 }
616792
617793 function test_greeterDoesNotChangeIndicatorProfile() {
794+ loadShell("phone");
795+ swipeAwayGreeter();
618796 var panel = findChild(shell, "panel");
619797 tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
620798
@@ -626,6 +804,8 @@ Item {
626804 }
627805
628806 function test_shellProfileChangesReachIndicators() {
807+ loadShell("phone");
808+ swipeAwayGreeter();
629809 var panel = findChild(shell, "panel");
630810
631811 shell.indicatorProfile = "test1";
@@ -642,6 +822,8 @@ Item {
642822 }
643823
644824 function test_focusRequestedHidesGreeter() {
825+ loadShell("phone");
826+ swipeAwayGreeter();
645827 var greeter = findChild(shell, "greeter");
646828
647829 var app = ApplicationManager.startApplication("dialer-app");
@@ -662,6 +844,8 @@ Item {
662844 }
663845
664846 function test_focusRequestedHidesIndicators() {
847+ loadShell("phone");
848+ swipeAwayGreeter();
665849 var indicators = findChild(shell, "indicators");
666850
667851 showIndicators();
@@ -674,6 +858,8 @@ Item {
674858 }
675859
676860 function test_showAndHideGreeterDBusCalls() {
861+ loadShell("phone");
862+ swipeAwayGreeter();
677863 var greeter = findChild(shell, "greeter")
678864 tryCompare(greeter, "shown", false)
679865 waitForRendering(greeter);
@@ -685,6 +871,9 @@ Item {
685871 }
686872
687873 function test_greeterLoginsAutomaticallyWhenNoPasswordSet() {
874+ loadShell("phone");
875+ swipeAwayGreeter();
876+
688877 sessionSpy.clear();
689878 verify(sessionSpy.valid);
690879
@@ -694,6 +883,8 @@ Item {
694883 }
695884
696885 function test_fullscreen() {
886+ loadShell("phone");
887+ swipeAwayGreeter();
697888 var panel = findChild(shell, "panel");
698889 compare(panel.fullscreenMode, false);
699890 ApplicationManager.startApplication("camera-app");
@@ -707,6 +898,8 @@ Item {
707898 }
708899
709900 function test_leftEdgeDragFullscreen() {
901+ loadShell("phone");
902+ swipeAwayGreeter();
710903 var panel = findChild(shell, "panel");
711904 tryCompare(panel, "fullscreenMode", false)
712905
@@ -728,6 +921,8 @@ Item {
728921 }
729922
730923 function test_unlockedProperties() {
924+ loadShell("phone");
925+ swipeAwayGreeter();
731926 // Confirm that various properties have the correct values when unlocked
732927 var greeter = findChild(shell, "greeter");
733928 tryCompare(greeter, "locked", false);
@@ -740,10 +935,14 @@ Item {
740935 }
741936
742937 function test_unlockAllModemsOnBoot() {
938+ loadShell("phone");
939+ swipeAwayGreeter();
743940 tryCompare(unlockAllModemsSpy, "count", 1)
744941 }
745942
746943 function test_tapOnRightEdgeReachesApplicationSurface() {
944+ loadShell("phone");
945+ swipeAwayGreeter();
747946 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
748947 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
749948 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -766,6 +965,8 @@ Item {
766965 by the right-edge drag area)
767966 */
768967 function test_rightEdgeDragDoesNotReachApplicationSurface() {
968+ loadShell("phone");
969+ swipeAwayGreeter();
769970 var topmostSpreadDelegate = findChild(shell, "appDelegate0");
770971 var topmostSurface = findChild(topmostSpreadDelegate, "surfaceContainer").surface;
771972 var rightEdgeDragArea = findChild(shell, "spreadDragArea");
@@ -810,6 +1011,8 @@ Item {
8101011 }
8111012
8121013 function test_tapUbuntuIconInLauncherOverAppSpread() {
1014+ loadShell("phone");
1015+ swipeAwayGreeter();
8131016
8141017 waitUntilFocusedApplicationIsShowingItsSurface();
8151018
@@ -856,19 +1059,75 @@ Item {
8561059 function test_background_data() {
8571060 return [
8581061 {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"},
8601063 {tag: "as-specified", accounts: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), gsettings: "", output: Qt.resolvedUrl("../data/unity/backgrounds/blue.png")},
8611064 {tag: "gs-specified", accounts: "", gsettings: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), output: Qt.resolvedUrl("../data/unity/backgrounds/red.png")},
8621065 {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")},
8631066 {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"},
8651068 ]
8661069 }
8671070 function test_background(data) {
1071+ loadShell("phone");
1072+ swipeAwayGreeter();
8681073 AccountsService.backgroundFile = data.accounts;
8691074 var backgroundSettings = findInvisibleChild(shell, "backgroundSettings");
8701075 backgroundSettings.pictureUri = data.gsettings;
871− tryCompare(shell, "background", data.output);
1076+
1077+ if (data.output === "defaultBackground") {
1078+ tryCompare(shell, "background", shell.defaultBackground);
1079+ } else {
1080+ tryCompare(shell, "background", data.output);
1081+ }
1082+ }
1083+
1084+ function test_tabletLogin_data() {
1085+ return [
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: ""},
1089+ ]
1090+ }
1091+
1092+ function test_tabletLogin(data) {
1093+ setLightDMMockMode("full");
1094+ loadShell("tablet");
1095+
1096+ selectUser(data.user);
1097+
1098+ clickPasswordInput(data.password === "" /* isButton */);
1099+
1100+ if (data.password !== "") {
1101+ typeString(data.password);
1102+ keyClick(Qt.Key_Enter);
1103+ }
1104+
1105+ confirmLoggedIn(data.loggedIn);
1106+ }
1107+
1108+ function test_appLaunchDuringGreeter_data() {
1109+ return [
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},
1113+ ]
1114+ }
1115+
1116+ function test_appLaunchDuringGreeter(data) {
1117+ setLightDMMockMode("full");
1118+ loadShell("tablet");
1119+
1120+ selectUser(data.user)
1121+
1122+ var greeter = findChild(shell, "greeter")
1123+ var app = ApplicationManager.startApplication("dialer-app")
1124+
1125+ confirmLoggedIn(data.loggedIn)
1126+
1127+ if (data.passwordFocus) {
1128+ var passwordInput = findChild(greeter, "passwordInput")
1129+ tryCompare(passwordInput, "focus", true)
1130+ }
8721131 }
8731132 }
8741133}