on xenial help sign in
Fix and improve qmluitest Shell.test_focusRequestedHidesGreeter
d5b39dcDaniel d'Andrada
tests/qmltests/tst_Shell.qml+16−6
@@ -519,14 +519,24 @@ Item {
519 }
519 }
520
520
521 function test_focusRequestedHidesGreeter() {
521 function test_focusRequestedHidesGreeter() {
522− var greeter = findChild(shell, "greeter")
522+ var greeter = findChild(shell, "greeter");
523
523
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);
526
527
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
527− ApplicationManager.focusRequested("notes-app")
538+ ApplicationManager.requestFocusApplication("dialer-app");
528− tryCompare(greeter, "showProgress", 0)
539+ tryCompare(greeter, "showProgress", 0);
529− waitUntilApplicationWindowIsFullyVisible()
530 }
540 }
531
541
532 function test_showGreeterDBusCall() {
542 function test_showGreeterDBusCall() {