summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-12-19 10:18:18 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-25 14:41:09 +0000
commita7f37f48d5691c9be4a419edc34396229a1b9bb5 (patch)
treec817effcf42f532d04b9a0352be10ea418e92cb2 /tests/auto/quick/qmltests/data
parentf4a8ce98bd371acf1ca1eb2c58a8403e8795a670 (diff)
Test adaptations for Chromium 63
Change-Id: I19bf693fb3916a78f4a199e6e095ca58b8fdfa27 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'tests/auto/quick/qmltests/data')
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml17
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml6
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml6
3 files changed, 15 insertions, 14 deletions
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index cadad4e27..f5e83c5d2 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -35,26 +35,27 @@ WebEngineView {
property bool windowCloseRequestedSignalEmitted: false
settings.focusOnNavigationEnabled: true
- function waitForLoadSucceeded() {
- var success = _waitFor(function() { return loadStatus == WebEngineView.LoadSucceededStatus })
+ function waitForLoadSucceeded(timeout) {
+ var success = _waitFor(function() { return loadStatus == WebEngineView.LoadSucceededStatus }, timeout)
loadStatus = null
return success
}
- function waitForLoadFailed() {
- var failure = _waitFor(function() { return loadStatus == WebEngineView.LoadFailedStatus })
+ function waitForLoadFailed(timeout) {
+ var failure = _waitFor(function() { return loadStatus == WebEngineView.LoadFailedStatus }, timeout)
loadStatus = null
return failure
}
- function waitForLoadStopped() {
- var stop = _waitFor(function() { return loadStatus == WebEngineView.LoadStoppedStatus })
+ function waitForLoadStopped(timeout) {
+ var stop = _waitFor(function() { return loadStatus == WebEngineView.LoadStoppedStatus }, timeout)
loadStatus = null
return stop
}
function waitForWindowCloseRequested() {
return _waitFor(function() { return windowCloseRequestedSignalEmitted; });
}
- function _waitFor(predicate) {
- var timeout = 12000
+ function _waitFor(predicate, timeout) {
+ if (timeout === undefined)
+ timeout = 12000;
var i = 0
while (i < timeout && !predicate()) {
testResult.wait(50)
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 80d7a18b3..37ba4da43 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -209,7 +209,7 @@ TestWebEngineView {
var bogusSite = "http://www.somesitethatdoesnotexist.abc/";
var handleLoadFailed = function(loadRequest) {
- if (loadRequest.status == WebEngineView.LoadFailedStatus) {
+ if (loadRequest.status === WebEngineView.LoadFailedStatus) {
// loadHtml constructs data URL
webEngineView.loadHtml("load failed", bogusSite);
compare(loadRequest.url, bogusSite);
@@ -231,7 +231,7 @@ TestWebEngineView {
loadRequest = loadRequestArray[2];
compare(loadRequest.status, WebEngineView.LoadStartedStatus);
compare(loadRequest.activeUrl, aboutBlank);
- compare(loadRequest.url, bogusSite)
+ compare(loadRequest.url, "data:text/html;charset=UTF-8,load failed")
loadRequest = loadRequestArray[3];
compare(loadRequest.status, WebEngineView.LoadSucceededStatus);
compare(loadRequest.activeUrl, bogusSite);
@@ -262,7 +262,7 @@ TestWebEngineView {
var loadRequest = null;
var handleLoadStarted = function(loadRequest) {
- if (loadRequest.status == WebEngineView.LoadStartedStatus)
+ if (loadRequest.status === WebEngineView.LoadStartedStatus)
webEngineView.stop();
}
webEngineView.loadingChanged.connect(handleLoadStarted);
diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml
index 576035ef2..a9cf11f34 100644
--- a/tests/auto/quick/qmltests/data/tst_viewSource.qml
+++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml
@@ -64,7 +64,7 @@ TestWebEngineView {
function init() {
webEngineView.url = Qt.resolvedUrl("test1.html");
- verify(webEngineView.waitForLoadSucceeded());
+ verify(webEngineView.waitForLoadSucceeded(20000));
newViewRequestedSpy.clear();
titleChangedSpy.clear();
@@ -113,9 +113,9 @@ TestWebEngineView {
webEngineView.url = row.userInputUrl;
if (row.loadSucceed) {
- verify(webEngineView.waitForLoadSucceeded());
+ verify(webEngineView.waitForLoadSucceeded(15000));
} else {
- verify(webEngineView.waitForLoadFailed());
+ verify(webEngineView.waitForLoadFailed(15000));
}
tryVerify(function() { return titleChangedSpy.count == 1; });