@@ -519,14 +519,24 @@ Item {
519519 }
520520
521521 function test_focusRequestedHidesGreeter() {
522− var greeter = findChild(shell, "greeter")
522+ var greeter = findChild(shell, "greeter");
523523
524− greeter.show()
525− tryCompare(greeter, "showProgress", 1)
524+ var app = ApplicationManager.startApplication("dialer-app");
525+ // wait until the app is fully loaded (ie, real surface replaces splash screen)
526+ tryCompareFunction(function() { return app.surface != null }, true);
526527
527− ApplicationManager.focusRequested("notes-app")
528− tryCompare(greeter, "showProgress", 0)
529− waitUntilApplicationWindowIsFullyVisible()
528+ // Minimize the application we just launched
529+ swipeFromLeftEdge(units.gu(27));
530+
531+ // Wait for the whole UI to settle down
532+ waitUntilApplicationWindowIsFullyHidden();
533+
534+ greeter.show();
535+ tryCompare(greeter, "showProgress", 1);
536+
537+ // The main point of this test
538+ ApplicationManager.requestFocusApplication("dialer-app");
539+ tryCompare(greeter, "showProgress", 0);
530540 }
531541
532542 function test_showGreeterDBusCall() {