summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-09-27 17:09:58 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-02-16 11:09:49 +0000
commit1ede9a1c8c82dd01de7d48721a691d52e7aab502 (patch)
tree737d9125269bca386427f2f5db35655adcd1c2dc
parent9464e7f4646ce4bdc8e16c1716bf07345531db28 (diff)
Speculative fix of user script QML tests
The sequence of the titleChanged and loadingChanged signals is not guaranteed. Wait for both of them to avoid flaky behavior. Task-number: QTBUG-58940 Change-Id: I981cd20f6535187fa0f8144db0084c8bb64ab41c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 25b50de487a34fb8ffcd6d891c833b2f2907c91c)
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml
index 358e8f56d..58969a2c9 100644
--- a/tests/auto/quick/qmltests/data/tst_userScripts.qml
+++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml
@@ -82,31 +82,31 @@ Item {
function test_oneScript() {
webEngineView.url = Qt.resolvedUrl("test1.html");
webEngineView.waitForLoadSucceeded();
- compare(webEngineView.title, "Test page 1");
+ tryCompare(webEngineView, "title", "Test page 1");
webEngineView.userScripts = [ changeDocumentTitleScript ];
compare(webEngineView.title, "Test page 1");
webEngineView.reload();
webEngineView.waitForLoadSucceeded();
- compare(webEngineView.title, "New title");
+ tryCompare(webEngineView, "title", "New title");
webEngineView.url = Qt.resolvedUrl("test2.html");
webEngineView.waitForLoadSucceeded();
- compare(webEngineView.title, "New title");
+ tryCompare(webEngineView, "title", "New title");
webEngineView.userScripts = [];
compare(webEngineView.title, "New title");
webEngineView.reload();
webEngineView.waitForLoadSucceeded();
- compare(webEngineView.title, "Test page with huge link area");
+ tryCompare(webEngineView, "title", "Test page with huge link area");
}
function test_twoScripts() {
webEngineView.url = Qt.resolvedUrl("test1.html");
webEngineView.waitForLoadSucceeded();
- compare(webEngineView.title, "Test page 1");
+ tryCompare(webEngineView, "title", "Test page 1");
webEngineView.userScripts = [ changeDocumentTitleScript, appendDocumentTitleScript ];
@@ -134,22 +134,22 @@ Item {
function test_setUserScriptsConditionally() {
webEngineViewWithConditionalUserScripts.url = Qt.resolvedUrl("test1.html");
webEngineViewWithConditionalUserScripts.waitForLoadSucceeded();
- compare(webEngineViewWithConditionalUserScripts.title, "New title");
+ tryCompare(webEngineViewWithConditionalUserScripts, "title", "New title");
webEngineViewWithConditionalUserScripts.url = Qt.resolvedUrl("test2.html");
webEngineViewWithConditionalUserScripts.waitForLoadSucceeded();
- compare(webEngineViewWithConditionalUserScripts.title, "Test page with huge link area with appendix");
+ tryCompare(webEngineViewWithConditionalUserScripts, "title", "Test page with huge link area with appendix");
webEngineViewWithConditionalUserScripts.url = Qt.resolvedUrl("test3.html");
webEngineViewWithConditionalUserScripts.waitForLoadSucceeded();
- compare(webEngineViewWithConditionalUserScripts.title, "Test page 3");
+ tryCompare(webEngineViewWithConditionalUserScripts, "title", "Test page 3");
}
function test_bigScript() {
webEngineView.userScripts = [ bigUserScript ];
webEngineView.url = Qt.resolvedUrl("test1.html");
webEngineView.waitForLoadSucceeded();
- compare(webEngineView.title, "Big user script changed title");
+ tryCompare(webEngineView , "title", "Big user script changed title");
}
}
}