on xenial help sign in
Fix and improve qmluitest Shell.test_focusRequestedHidesGreeter
commitd5b39dc62862171367c9e670a9d887ca8b5d43ca authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 23 Jul 2014, 14:39 (12 years ago) parent9a66aac
1 file changed+16−6
tests/qmltests/tst_Shell.qml+16−6
tests/qmltests/tst_Shell.qml+16−6
@@ -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() {