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