From 7757ec1a562ae36b65a6cae93b3cd308247755ef Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 9 May 2018 17:25:22 +0200 Subject: Adaptations for Chromium 67 Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek --- tests/auto/quick/inspectorserver/tst_inspectorserver.cpp | 2 +- tests/auto/quick/qmltests/data/tst_favicon.qml | 4 ++-- tests/auto/quick/qmltests/data/tst_getUserMedia.qml | 3 +++ tests/auto/quick/qmltests/data/tst_loadUrl.qml | 4 ++-- tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp | 2 +- tests/auto/widgets/origins/tst_origins.cpp | 4 ++-- .../auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp | 4 ++-- .../qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp | 2 +- tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 9 +++++++++ tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp | 8 ++------ tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp | 7 +++---- 11 files changed, 28 insertions(+), 21 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp index 5f47ee797..8e23e86e8 100644 --- a/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp +++ b/tests/auto/quick/inspectorserver/tst_inspectorserver.cpp @@ -167,7 +167,7 @@ void tst_InspectorServer::openRemoteDebuggingSession() // - The page list didn't return a valid inspector URL // - Or the front-end couldn't be loaded through the inspector HTTP server // - Or the web socket connection couldn't be established between the front-end and the page through the inspector server - QTRY_VERIFY(inspectorWebView->title().startsWith("Developer Tools -")); + QTRY_VERIFY(inspectorWebView->title().startsWith("DevTools -")); } QTEST_MAIN(tst_InspectorServer) diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml index 0aa8f0bb8..563a87c83 100644 --- a/tests/auto/quick/qmltests/data/tst_favicon.qml +++ b/tests/auto/quick/qmltests/data/tst_favicon.qml @@ -182,7 +182,7 @@ TestWebEngineView { var url = Qt.resolvedUrl("http://url.invalid") webEngineView.url = url - verify(webEngineView.waitForLoadFailed()) + verify(webEngineView.waitForLoadFailed(20000)) verify(webEngineView.testSupport.waitForErrorPageLoadSucceeded()) compare(iconChangedSpy.count, 0) @@ -198,7 +198,7 @@ TestWebEngineView { var url = Qt.resolvedUrl("http://url.invalid") webEngineView.url = url - verify(webEngineView.waitForLoadFailed()) + verify(webEngineView.waitForLoadFailed(20000)) compare(iconChangedSpy.count, 0) diff --git a/tests/auto/quick/qmltests/data/tst_getUserMedia.qml b/tests/auto/quick/qmltests/data/tst_getUserMedia.qml index b497542e3..d1c894699 100644 --- a/tests/auto/quick/qmltests/data/tst_getUserMedia.qml +++ b/tests/auto/quick/qmltests/data/tst_getUserMedia.qml @@ -32,11 +32,14 @@ import QtWebEngine 1.6 TestWebEngineView { id: webEngineView + width: 400 + height: 400 settings.screenCaptureEnabled: true TestCase { name: "GetUserMedia" + when: windowShown function init_data() { return [ diff --git a/tests/auto/quick/qmltests/data/tst_loadUrl.qml b/tests/auto/quick/qmltests/data/tst_loadUrl.qml index d1b6d6099..ec5c965ea 100644 --- a/tests/auto/quick/qmltests/data/tst_loadUrl.qml +++ b/tests/auto/quick/qmltests/data/tst_loadUrl.qml @@ -204,7 +204,7 @@ TestWebEngineView { // Test loadHtml after a failed load var aboutBlank = "about:blank"; webEngineView.url = aboutBlank; // Reset from previous test - verify(webEngineView.waitForLoadSucceeded()); + tryCompare(loadRequestArray, "length", 2); webEngineView.clear(); var bogusSite = "http://www.somesitethatdoesnotexist.abc/"; @@ -217,7 +217,7 @@ TestWebEngineView { } webEngineView.loadingChanged.connect(handleLoadFailed); webEngineView.url = bogusSite - tryCompare(loadRequestArray, "length", 4, 12000); + tryCompare(loadRequestArray, "length", 4, 30000); webEngineView.loadingChanged.disconnect(handleLoadFailed); loadRequest = loadRequestArray[0]; diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 42e96c0f5..cf695228c 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -364,7 +364,7 @@ void tst_QQuickWebEngineView::basicRenderingSanity() { showWebEngineView(); - webEngineView()->setUrl(QUrl(QString::fromUtf8("data:text/html,"))); + webEngineView()->setUrl(QUrl(QString::fromUtf8("data:text/html,"))); QVERIFY(waitForLoadSucceeded(webEngineView())); // This should not crash. diff --git a/tests/auto/widgets/origins/tst_origins.cpp b/tests/auto/widgets/origins/tst_origins.cpp index d6eeff204..6b1b4bba5 100644 --- a/tests/auto/widgets/origins/tst_origins.cpp +++ b/tests/auto/widgets/origins/tst_origins.cpp @@ -257,10 +257,10 @@ void tst_Origins::webSocket() const int expected = 1006; QVERIFY(load(QSL("file:" THIS_DIR "resources/websocket.html"))); - QTRY_COMPARE_WITH_TIMEOUT(eval(QSL("err")), QVariant(expected), 10000); + QTRY_COMPARE_WITH_TIMEOUT(eval(QSL("err")), QVariant(expected), 20000); QVERIFY(load(QSL("qrc:/resources/websocket.html"))); - QTRY_COMPARE_WITH_TIMEOUT(eval(QSL("err")), QVariant(expected), 10000); + QTRY_COMPARE_WITH_TIMEOUT(eval(QSL("err")), QVariant(expected), 20000); QVERIFY(load(QSL("tst:/resources/websocket.html"))); QTRY_VERIFY(eval(QSL("err")) == QVariant(expected)); diff --git a/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp b/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp index f932d50c3..34bfb6bb6 100644 --- a/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp +++ b/tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp @@ -284,7 +284,7 @@ void tst_QWebEngineDownloads::downloadLink_data() /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain") /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain") /* fileDisposition */ << QByteArrayLiteral("") - /* fileHasReferer */ << true + /* fileHasReferer */ << false // crbug.com/455987 /* fileAction */ << FileIsDownloaded; // ... same with the content disposition header save for the download type. @@ -308,7 +308,7 @@ void tst_QWebEngineDownloads::downloadLink_data() /* fileMimeTypeDeclared */ << QByteArrayLiteral("text/plain") /* fileMimeTypeDetected */ << QByteArrayLiteral("text/plain") /* fileDisposition */ << QByteArrayLiteral("attachment") - /* fileHasReferer */ << true + /* fileHasReferer */ << false // crbug.com/455987 /* fileAction */ << FileIsDownloaded; // The file's extension has no effect. diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp index da041ee59..49984f987 100644 --- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp +++ b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp @@ -239,7 +239,7 @@ void tst_QWebEngineFaviconManager::errorPageEnabled() QUrl url("http://url.invalid"); m_page->load(url); - QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 14000); + QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.count(), 1, 20000); QCOMPARE(iconUrlChangedSpy.count(), 0); QCOMPARE(iconChangedSpy.count(), 0); diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 0673b67ee..ed545fa80 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -2395,6 +2395,15 @@ void tst_QWebEnginePage::getUserMediaRequest() QFETCH(QWebEnginePage::Feature, feature); GetUserMediaTestPage page; + if (feature == QWebEnginePage::DesktopVideoCapture || feature == QWebEnginePage::DesktopAudioVideoCapture) { + // Desktop capture needs to be on a desktop. + QWebEngineView view; + view.setPage(&page); + view.resize(640, 480); + view.show(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + } + QTRY_VERIFY_WITH_TIMEOUT(page.loadSucceeded(), 20000); page.settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true); diff --git a/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp b/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp index 150b3c554..0704cf383 100644 --- a/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp +++ b/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp @@ -42,8 +42,6 @@ private Q_SLOTS: void tst_QWebEngineSettings::resetAttributes() { - // QT_TODO_FIXME_ADAPT - QSKIP("The application deadlocks and hangs without exiting."); QWebEngineProfile profile; QWebEngineSettings *settings = profile.settings(); @@ -85,8 +83,6 @@ void tst_QWebEngineSettings::defaultFontFamily_data() void tst_QWebEngineSettings::defaultFontFamily() { - // QT_TODO_FIXME_ADAPT - QSKIP("The application deadlocks and hangs without exiting."); QWebEngineProfile profile; QWebEngineSettings *settings = profile.settings(); @@ -151,8 +147,8 @@ void tst_QWebEngineSettings::javascriptClipboard() QCOMPARE(evaluateJavaScriptSync(&page, "document.queryCommandEnabled('copy')").toBool(), copyResult); QCOMPARE(evaluateJavaScriptSync(&page, "document.execCommand('copy')").toBool(), copyResult); - QCOMPARE(QApplication::clipboard()->text(), - (copyResult ? QString("OriginalText") : QString())); + QTRY_COMPARE(QApplication::clipboard()->text(), + (copyResult ? QString("OriginalText") : QString())); QGuiApplication::clipboard()->setText("AnotherText"); diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index 2a39124d4..d7ae96962 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -1069,7 +1069,7 @@ void tst_QWebEngineView::changeLocale() QWebEngineView viewDE; QSignalSpy loadFinishedSpyDE(&viewDE, SIGNAL(loadFinished(bool))); viewDE.load(url); - QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 12000); + QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 20000); QTRY_VERIFY(!toPlainTextSync(viewDE.page()).isEmpty()); errorLines = toPlainTextSync(viewDE.page()).split(QRegExp("[\r\n]"), QString::SkipEmptyParts); @@ -1079,7 +1079,7 @@ void tst_QWebEngineView::changeLocale() QWebEngineView viewEN; QSignalSpy loadFinishedSpyEN(&viewEN, SIGNAL(loadFinished(bool))); viewEN.load(url); - QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyEN.count(), 1, 12000); + QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyEN.count(), 1, 20000); QTRY_VERIFY(!toPlainTextSync(viewEN.page()).isEmpty()); errorLines = toPlainTextSync(viewEN.page()).split(QRegExp("[\r\n]"), QString::SkipEmptyParts); @@ -1092,7 +1092,7 @@ void tst_QWebEngineView::changeLocale() // Check whether an existing QWebEngineView keeps the language settings after changing the default locale viewDE.load(url); - QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 12000); + QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 20000); QTRY_VERIFY(!toPlainTextSync(viewDE.page()).isEmpty()); errorLines = toPlainTextSync(viewDE.page()).split(QRegExp("[\r\n]"), QString::SkipEmptyParts); @@ -2724,7 +2724,6 @@ void tst_QWebEngineView::webUIURLs_data() QTest::newRow("usb-internals") << QUrl("chrome://usb-internals") << false; QTest::newRow("user-actions") << QUrl("chrome://user-actions") << false; QTest::newRow("version") << QUrl("chrome://version") << false; - QTest::newRow("view-http-cache") << QUrl("chrome://view-http-cache") << true; QTest::newRow("webrtc-internals") << QUrl("chrome://webrtc-internals") << true; QTest::newRow("webrtc-logs") << QUrl("chrome://webrtc-logs") << false; } -- cgit v1.2.3