summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests
diff options
context:
space:
mode:
authorTamas Zakor <ztamas@inf.u-szeged.hu>2020-11-09 16:28:04 +0100
committerTamas Zakor <ztamas@inf.u-szeged.hu>2020-12-03 14:16:50 +0100
commitb719da05c6429d72f4e0e0af44da0bf3f3e57984 (patch)
tree60b715db5557dfa60bd13c085e8284cab875005e /tests/auto/quick/qmltests
parent7adea5999b3eb1ac77adeb0580cb98ce35eb6ffd (diff)
Stabilize load signals emitting
Make the WebContentsDelegateQt::EmitLoadStarted() and the WebContentsDelegateQt::EmitLoadFinished() independent from the WebContentsDelegateQt::LoadProgressChanged() by removing m_lastLoadProgress. Adapt the WebContentsDelegateQt::LoadProgressChanged() to send signal only if load is in progress. Add a new test based on the bugreport. Fix qmltests::WebEngineViewSource::test_viewSourceURL() flaky tests. Fixes: QTBUG-65223 Fixes: QTBUG-87089 Change-Id: I90af4d2e85105dba801beb8102991eb4ef14c6a3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests')
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml30
3 files changed, 1 insertions, 33 deletions
diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST
deleted file mode 100644
index 46bc65923..000000000
--- a/tests/auto/quick/qmltests/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[WebEngineViewSource::test_viewSourceURL]
-*
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 872c46641..47dbbc087 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -301,8 +301,8 @@ TestWebEngineView {
// In-page navigation.
webEngineView.url = Qt.resolvedUrl("test4.html#content");
// In-page navigation doesn't trigger load succeeded, wait for load progress instead.
+ tryCompare(loadRequestArray, "length", 3);
tryCompare(webEngineView, "loadProgress", 100);
- compare(loadRequestArray.length, 3);
compare(loadRequestArray[2].status, WebEngineView.LoadStartedStatus);
// Load after in-page navigation.
diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml
index 4966a052a..22c340c2b 100644
--- a/tests/auto/quick/qmltests/data/tst_viewSource.qml
+++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml
@@ -94,36 +94,6 @@ TestWebEngineView {
compare(webEngineView.url, "view-source:" + Qt.resolvedUrl("test1.html"));
}
- function test_viewSourceURL_data() {
- var testLocalUrl = "view-source:" + Qt.resolvedUrl("test1.html");
- var testLocalUrlWithoutScheme = "view-source:" + Qt.resolvedUrl("test1.html").substring(7);
-
- return [
- { tag: "view-source:", userInputUrl: "view-source:", loadSucceed: true, url: "view-source:", title: "view-source:" },
- { tag: "view-source:about:blank", userInputUrl: "view-source:about:blank", loadSucceed: true, url: "view-source:about:blank", title: "view-source:about:blank" },
- { tag: testLocalUrl, userInputUrl: testLocalUrl, loadSucceed: true, url: testLocalUrl, title: "test1.html" },
- { tag: testLocalUrlWithoutScheme, userInputUrl: testLocalUrlWithoutScheme, loadSucceed: true, url: testLocalUrl, title: "test1.html" },
- { tag: "view-source:http://non.existent", userInputUrl: "view-source:http://non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" },
- { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "http://non.existent/", title: "non.existent" },
- ];
- }
-
- function test_viewSourceURL(row) {
- WebEngine.settings.errorPageEnabled = true
- webEngineView.url = row.userInputUrl;
-
- if (row.loadSucceed) {
- tryCompare(webEngineView, "loadStatus", WebEngineView.LoadSucceededStatus);
- } else {
- tryCompare(webEngineView, "loadStatus", WebEngineView.LoadFailedStatus, 15000);
- }
- tryVerify(function() { return titleChangedSpy.count == 1; });
-
- compare(webEngineView.url, row.url);
- tryCompare(webEngineView, "title", row.title);
- verify(!webEngineView.action(WebEngineView.ViewSource).enabled);
- }
-
function test_viewSourceCredentials() {
var url = "http://user:passwd@httpbin.org/basic-auth/user/passwd";