summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2017-11-22 08:45:51 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2017-11-23 05:52:51 +0000
commit781111af3498527d8652ae02fa64be3114c0734f (patch)
treec0c19cfdefdedb976f468560154f677a74b9dfef /tests
parent188f1a64d27dd88950c212484e03dc23b817e1c3 (diff)
Speculative stabilization of mouseLeave auto tests
Occasionally the mouse pointer might be moved above the testDiv during the html load and this changes its text. This seems to happen on CI from time to time. Text of testDiv is expected to be empty in the beginning to make sure an explicit mouse move event changes its text. Change-Id: Ib8488b1e2dd7cc80b78cc40adecbf04c12dbec1b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_mouseMove.qml4
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_mouseMove.qml b/tests/auto/quick/qmltests/data/tst_mouseMove.qml
index adb937139..adfa3941c 100644
--- a/tests/auto/quick/qmltests/data/tst_mouseMove.qml
+++ b/tests/auto/quick/qmltests/data/tst_mouseMove.qml
@@ -81,7 +81,9 @@ Rectangle {
"</body>" +
"</html>");
verify(webEngineView.waitForLoadSucceeded());
- verify(!webEngineView.getInnerText("testDiv"));
+ // Make sure the testDiv text is empty.
+ webEngineView.runJavaScript("document.getElementById('testDiv').innerText = ''");
+ tryVerify(function() { return !webEngineView.getInnerText("testDiv") });
for (var i = 90; i < 110; ++i)
mouseMove(root, 50, i);
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 8d2f92d96..530b71129 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -2469,7 +2469,9 @@ void tst_QWebEngineView::mouseLeave()
"</body>"
"</html>");
QVERIFY(loadFinishedSpy.wait());
- QVERIFY(innerText().isEmpty());
+ // Make sure the testDiv text is empty.
+ evaluateJavaScriptSync(view->page(), "document.getElementById('testDiv').innerText = ''");
+ QTRY_VERIFY(innerText().isEmpty());
QTest::mouseMove(containerWidget->windowHandle(), QPoint(50, 150));
QTRY_COMPARE(innerText(), QStringLiteral("Mouse IN"));