summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-02-08 13:41:15 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-01 12:06:35 +0000
commit70a76770763a4abd5cc9ce27659db16746dce06c (patch)
tree949350035ce0c254926cbfb24f413992aa8cd3a7 /tests/auto
parenta6e3b9113ba28fee9f705bb93cddaadfec43a917 (diff)
Update auto tests for Chromium 55
Load failures now have a Chromium side timeout of 10s so we need to wait longer than that. Additionally error-pages no longer have descriptive titles, so we can not rely on that in our tests any longer. Change-Id: I33ac8b9f1247403eb214f7260267edb887fe10d0 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadFail.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadUrl.qml4
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml4
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp1
-rw-r--r--tests/auto/quick/shared/util.h2
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp16
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp1
8 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index aa1f77942..a7d890072 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -53,7 +53,7 @@ WebEngineView {
return _waitFor(function() { return windowCloseRequestedSignalEmitted; });
}
function _waitFor(predicate) {
- var timeout = 5000
+ var timeout = 12000
var i = 0
while (i < timeout && !predicate()) {
testResult.wait(50)
diff --git a/tests/auto/quick/qmltests/data/tst_loadFail.qml b/tests/auto/quick/qmltests/data/tst_loadFail.qml
index 9ce70fc96..47f4a2862 100644
--- a/tests/auto/quick/qmltests/data/tst_loadFail.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadFail.qml
@@ -139,7 +139,7 @@ TestWebEngineView {
verify(loadRequest.isErrorPage)
compare(webEngineView.url, unavailableUrl)
- compare(webEngineView.title, unavailableUrl + " failed to load")
+ compare(webEngineView.title, unavailableUrl)
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
index 2a43e1577..2cb9f6b81 100644
--- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml
@@ -126,7 +126,7 @@ TestWebEngineView {
// Test failed load
var bogusSite = "http://www.somesitethatdoesnotexist.abc/";
webEngineView.url = bogusSite;
- tryCompare(loadRequestArray, "length", 2);
+ tryCompare(loadRequestArray, "length", 2, 12000);
loadRequest = loadRequestArray[0];
compare(loadRequest.status, WebEngineView.LoadStartedStatus);
@@ -217,7 +217,7 @@ TestWebEngineView {
}
webEngineView.loadingChanged.connect(handleLoadFailed);
webEngineView.url = bogusSite
- tryCompare(loadRequestArray, "length", 4);
+ tryCompare(loadRequestArray, "length", 4, 12000);
webEngineView.loadingChanged.disconnect(handleLoadFailed);
loadRequest = loadRequestArray[0];
diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml
index 8076d99f8..22c3947d3 100644
--- a/tests/auto/quick/qmltests/data/tst_viewSource.qml
+++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml
@@ -103,8 +103,8 @@ TestWebEngineView {
{ 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: "view-source:http://non.existent/", title: "http://non.existent/ is not available" },
- { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "view-source:http://non.existent/", title: "http://non.existent/ is not available" },
+ { tag: "view-source:http://non.existent", userInputUrl: "view-source:http://non.existent", loadSucceed: false, url: "view-source:http://non.existent/", title: "non.existent" },
+ { tag: "view-source:non.existent", userInputUrl: "view-source:non.existent", loadSucceed: false, url: "view-source:http://non.existent/", title: "non.existent" },
];
}
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index dcc2c4f5e..699c7028b 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -684,6 +684,7 @@ void tst_QQuickWebEngineView::inputEventForwardingDisabledWhenActiveFocusOnPress
void tst_QQuickWebEngineView::changeLocale()
{
+ QSKIP("Error pages no longer have useful titles in Chromium 55");
QUrl url("http://non.existent/");
QLocale::setDefault(QLocale("de"));
diff --git a/tests/auto/quick/shared/util.h b/tests/auto/quick/shared/util.h
index 674c2da34..98a7c1007 100644
--- a/tests/auto/quick/shared/util.h
+++ b/tests/auto/quick/shared/util.h
@@ -98,7 +98,7 @@ inline bool waitForLoadSucceeded(QQuickWebEngineView *webEngineView, int timeout
return spy.wait(timeout);
}
-inline bool waitForLoadFailed(QQuickWebEngineView *webEngineView, int timeout = 10000)
+inline bool waitForLoadFailed(QQuickWebEngineView *webEngineView, int timeout = 20000)
{
LoadSpy loadSpy(webEngineView);
QSignalSpy spy(&loadSpy, &LoadSpy::loadFailed);
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 7e78e2b0e..cf409654c 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -3713,8 +3713,7 @@ void tst_QWebEnginePage::requestedUrlAfterSetAndLoadFailures()
const QUrl first("http://abcdef.abcdef/");
page.setUrl(first);
- QVERIFY(spy.wait());
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 12000);
QCOMPARE(page.url(), first);
QCOMPARE(page.requestedUrl(), first);
QVERIFY(!spy.at(0).first().toBool());
@@ -3723,8 +3722,7 @@ void tst_QWebEnginePage::requestedUrlAfterSetAndLoadFailures()
QVERIFY(first != second);
page.load(second);
- QVERIFY(spy.wait());
- QCOMPARE(spy.count(), 2);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 12000);
QCOMPARE(page.url(), first);
QCOMPARE(page.requestedUrl(), second);
QVERIFY(!spy.at(1).first().toBool());
@@ -4494,11 +4492,11 @@ void tst_QWebEnginePage::loadFinishedAfterNotFoundError()
page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
page.setUrl(QUrl("http://non.existent/url"));
- QTRY_COMPARE(spy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 1, 12000);
page.settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
page.setUrl(QUrl("http://another.non.existent/url"));
- QTRY_COMPARE(spy.count(), 2);
+ QTRY_COMPARE_WITH_TIMEOUT(spy.count(), 2, 12000);
}
class URLSetter : public QObject {
@@ -4816,8 +4814,8 @@ void tst_QWebEnginePage::viewSourceURL_data()
QUrl testResourceUrl = QUrl(QString("view-source:%1").arg(resourcePath));
QTest::newRow(testResourceUrl.toString().toStdString().c_str()) << testResourceUrl << true << testResourceUrl << QUrl(resourcePath) << testResourceUrl.toString();
- QTest::newRow("view-source:http://non.existent") << QUrl("view-source:non.existent") << false << QUrl("view-source:http://non.existent/") << QUrl("http://non.existent/") << QString("http://non.existent/ is not available");
- QTest::newRow("view-source:non.existent") << QUrl("view-source:non.existent") << false << QUrl("view-source:http://non.existent/") << QUrl("http://non.existent/") << QString("http://non.existent/ is not available");
+ QTest::newRow("view-source:http://non.existent") << QUrl("view-source:non.existent") << false << QUrl("view-source:http://non.existent/") << QUrl("http://non.existent/") << QString("non.existent");
+ QTest::newRow("view-source:non.existent") << QUrl("view-source:non.existent") << false << QUrl("view-source:http://non.existent/") << QUrl("http://non.existent/") << QString("non.existent");
}
void tst_QWebEnginePage::viewSourceURL()
@@ -4835,7 +4833,7 @@ void tst_QWebEnginePage::viewSourceURL()
QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
page.load(userInputUrl);
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 12000);
QList<QVariant> arguments = loadFinishedSpy.takeFirst();
QCOMPARE(arguments.at(0).toBool(), loadSucceed);
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index b173c3474..0451a8c0f 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -854,6 +854,7 @@ void tst_QWebEngineView::focusOnNavigation()
void tst_QWebEngineView::changeLocale()
{
+ QSKIP("Error pages no longer have useful titles in Chromium 55");
QUrl url("http://non.existent/");
QLocale::setDefault(QLocale("de"));