@@ -251,6 +251,21 @@ Rectangle {
252 var launcher = findChild(shell, "launcher");
252 var launcher = findChild(shell, "launcher");
253 launcherShowDashHomeSpy.target = launcher;
253 launcherShowDashHomeSpy.target = launcher;
255+ waitForGreeterToStabilize();
258+ function waitForGreeterToStabilize() {
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);
256 function tearDown() {
271 function tearDown() {
@@ -674,6 +689,7 @@ Rectangle {
674 function test_launchedAppHasActiveFocus(data) {
689 function test_launchedAppHasActiveFocus(data) {
675 loadShell(data.formFactor);
690 loadShell(data.formFactor);
676 swipeAwayGreeter();
691 swipeAwayGreeter();
677 var dialerApp = ApplicationManager.startApplication("webbrowser-app");
693 var dialerApp = ApplicationManager.startApplication("webbrowser-app");
678 verify(dialerApp);
694 verify(dialerApp);
679 waitUntilAppSurfaceShowsUp("webbrowser-app")
695 waitUntilAppSurfaceShowsUp("webbrowser-app")
@@ -683,18 +699,6 @@ Rectangle {
683 tryCompare(dialerApp.session.surface, "activeFocus", true);
699 tryCompare(dialerApp.session.surface, "activeFocus", true);
686− // Wait for the whole UI to settle down
687− function waitForUIToSettle() {
688− var launcher = findChild(shell, "launcherPanel")
689− tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
690− if (launcher.x === 0) {
693− tryCompare(launcher, "x", -launcher.width)
695− waitForRendering(shell)
698 function waitUntilAppSurfaceShowsUp(appId) {
702 function waitUntilAppSurfaceShowsUp(appId) {
699 var appWindow = findChild(shell, "appWindow_" + appId);
703 var appWindow = findChild(shell, "appWindow_" + appId);
700 verify(appWindow);
704 verify(appWindow);