From 71916012ea9434247c31e361a3033ae69c4781c6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 31 May 2016 09:51:04 +0200 Subject: Fix QML geolocation test The test had a race condition and never waited for success or failure. In addition it didn't handle the case where there is no location service available. Change-Id: Icac02d0cc6396f31fed83b8b77b691ba872ac2f0 Reviewed-by: Joerg Bornemann --- tests/auto/quick/qmltests/data/tst_geopermission.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/auto/quick/qmltests/data/tst_geopermission.qml') diff --git a/tests/auto/quick/qmltests/data/tst_geopermission.qml b/tests/auto/quick/qmltests/data/tst_geopermission.qml index a08ec155c..642cf2016 100644 --- a/tests/auto/quick/qmltests/data/tst_geopermission.qml +++ b/tests/auto/quick/qmltests/data/tst_geopermission.qml @@ -83,8 +83,9 @@ TestWebEngineView { featurePermissionSpy.wait() verify(geoPermissionRequested) compare(featurePermissionSpy.count, 1) - if (consoleErrorMessageSpy.count) // Print the error message if it fails to get user's location - fail(consoleErrorMessageSpy.signalArguments[0][0]) + consoleErrorMessageSpy.wait() + verify(consoleErrorMessageSpy.signalArguments[0][0] === "Success" || + consoleErrorMessageSpy.signalArguments[0][0] === "") } function test_deniedGeolocationByUser() { -- cgit v1.2.3