From d6c32fa215080ad8094c699f40e1823d3ca2a14c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 29 Feb 2016 11:07:06 +0100 Subject: Enable qmltests in CI Blacklist failing tests. Stabilize some tests. Change-Id: I9fba81fb70f5b358108ef6935e363297e2658f79 Reviewed-by: Allan Sandfeld Jensen --- tests/auto/quick/qmltests/data/tst_geopermission.qml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 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 acb561825..e18b40f1d 100644 --- a/tests/auto/quick/qmltests/data/tst_geopermission.qml +++ b/tests/auto/quick/qmltests/data/tst_geopermission.qml @@ -50,7 +50,7 @@ TestWebEngineView { property bool deniedGeolocation: false property bool geoPermissionRequested: false - property string consoleErrorMessage: "" + signal consoleErrorMessage(string message) SignalSpy { id: featurePermissionSpy @@ -58,6 +58,12 @@ TestWebEngineView { signalName: "featurePermissionRequested" } + SignalSpy { + id: consoleErrorMessageSpy + target: webEngineView + signalName: "consoleErrorMessage" + } + onFeaturePermissionRequested: { if (feature === WebEngineView.Geolocation) { geoPermissionRequested = true @@ -72,7 +78,7 @@ TestWebEngineView { onJavaScriptConsoleMessage: { if (level === WebEngineView.ErrorMessageLevel) - consoleErrorMessage = message + consoleErrorMessage(message) } TestCase { @@ -81,8 +87,8 @@ TestWebEngineView { function init() { deniedGeolocation = false - consoleErrorMessage = "" featurePermissionSpy.clear() + consoleErrorMessageSpy.clear() } function test_geoPermissionRequest() { @@ -91,15 +97,16 @@ TestWebEngineView { featurePermissionSpy.wait() verify(geoPermissionRequested) compare(featurePermissionSpy.count, 1) - if (consoleErrorMessage) // Print the error message if it fails to get user's location - fail(consoleErrorMessage) + if (consoleErrorMessageSpy.count) // Print the error message if it fails to get user's location + fail(consoleErrorMessageSpy.signalArguments[0][0]) } function test_deniedGeolocationByUser() { deniedGeolocation = true webEngineView.url = Qt.resolvedUrl("geolocation.html") featurePermissionSpy.wait() - compare(consoleErrorMessage, "User denied Geolocation") + consoleErrorMessageSpy.wait() + compare(consoleErrorMessageSpy.signalArguments[0][0], "User denied Geolocation") } } } -- cgit v1.2.3