From 9daa85a3f12c6ce0e6908598c6f54a7dac28ce79 Mon Sep 17 00:00:00 2001
From: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Date: Wed, 9 Dec 2015 12:26:44 +0100
Subject: [PATCH] Stabilize tst_QWebEnginePage::getUserMediaRequest

Do not use 100 ms timeouts.

Change-Id: Ied4a9a8b9af6ac33c025930a823d334000be2945
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
---
 tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index d7e11eb06..8fb76492e 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -3479,16 +3479,16 @@ void tst_QWebEnginePage::getUserMediaRequest()
 
     QVERIFY(evaluateJavaScriptSync(page, QStringLiteral("!!navigator.webkitGetUserMedia")).toBool());
     evaluateJavaScriptSync(page, QStringLiteral("navigator.webkitGetUserMedia({audio: true}, function() {}, function(){})"));
-    QTRY_VERIFY_WITH_TIMEOUT(page->gotFeatureRequest(QWebEnginePage::MediaAudioCapture), 100);
+    QTRY_VERIFY(page->gotFeatureRequest(QWebEnginePage::MediaAudioCapture));
     // Might end up failing due to the lack of physical media devices deeper in the content layer, so the JS callback is not guaranteed to be called,
     // but at least we go through that code path, potentially uncovering failing assertions.
     page->acceptPendingRequest();
 
     page->runJavaScript(QStringLiteral("errorCallbackCalled = false;"));
     evaluateJavaScriptSync(page, QStringLiteral("navigator.webkitGetUserMedia({audio: true, video: true}, function() {}, function(){errorCallbackCalled = true;})"));
-    QTRY_VERIFY_WITH_TIMEOUT(page->gotFeatureRequest(QWebEnginePage::MediaAudioVideoCapture), 100);
+    QTRY_VERIFY(page->gotFeatureRequest(QWebEnginePage::MediaAudioVideoCapture));
     page->rejectPendingRequest(); // Should always end up calling the error callback in JS.
-    QTRY_VERIFY_WITH_TIMEOUT(evaluateJavaScriptSync(page, QStringLiteral("errorCallbackCalled;")).toBool(), 100);
+    QTRY_VERIFY(evaluateJavaScriptSync(page, QStringLiteral("errorCallbackCalled;")).toBool());
     delete page;
 }
 
-- 
GitLab