diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/quick/inspectorserver/BLACKLIST | 5 | ||||
-rw-r--r-- | tests/auto/quick/publicapi/tst_publicapi.cpp | 3 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/BLACKLIST | 9 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_download.qml | 2 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_geopermission.qml | 19 | ||||
-rw-r--r-- | tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro | 1 | ||||
-rw-r--r-- | tests/auto/quick/tests.pri | 4 | ||||
-rw-r--r-- | tests/auto/widgets/positionplugin/positionplugin.pro | 11 | ||||
-rw-r--r-- | tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 105 |
9 files changed, 38 insertions, 121 deletions
diff --git a/tests/auto/quick/inspectorserver/BLACKLIST b/tests/auto/quick/inspectorserver/BLACKLIST new file mode 100644 index 000000000..f80823bf3 --- /dev/null +++ b/tests/auto/quick/inspectorserver/BLACKLIST @@ -0,0 +1,5 @@ +[testRemoteDebuggingMessage] +osx + +[openRemoteDebuggingSession] +osx diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 15c1680f9..47d44cd7f 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -230,10 +230,12 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineDownloadItem.state --> DownloadState" << "QQuickWebEngineDownloadItem.totalBytes --> qlonglong" << "QQuickWebEngineDownloadItem.receivedBytes --> qlonglong" + << "QQuickWebEngineDownloadItem.mimeType --> QString" << "QQuickWebEngineDownloadItem.path --> QString" << "QQuickWebEngineDownloadItem.stateChanged() --> void" << "QQuickWebEngineDownloadItem.receivedBytesChanged() --> void" << "QQuickWebEngineDownloadItem.totalBytesChanged() --> void" + << "QQuickWebEngineDownloadItem.mimeTypeChanged() --> void" << "QQuickWebEngineDownloadItem.pathChanged() --> void" << "QQuickWebEngineDownloadItem.accept() --> void" << "QQuickWebEngineDownloadItem.cancel() --> void" @@ -278,7 +280,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void" << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void" << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void" - << "QQuickWebEngineProfile.cookieStore() --> QWebEngineCookieStore*" << "QQuickWebEngineScript.Deferred --> InjectionPoint" << "QQuickWebEngineScript.DocumentReady --> InjectionPoint" << "QQuickWebEngineScript.DocumentCreation --> InjectionPoint" diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST new file mode 100644 index 000000000..3abcd82d0 --- /dev/null +++ b/tests/auto/quick/qmltests/BLACKLIST @@ -0,0 +1,9 @@ +[DesktopWebEngineViewLinkHovered::test_linkHovered] +* + +[WebViewGeopermission::test_deniedGeolocationByUser] +osx + +[WebViewGeopermission::test_geoPermissionRequest] +osx +windows diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml index 6df654ae6..7d1e24b4d 100644 --- a/tests/auto/quick/qmltests/data/tst_download.qml +++ b/tests/auto/quick/qmltests/data/tst_download.qml @@ -114,7 +114,7 @@ TestWebEngineView { compare(downloadState[1], WebEngineDownloadItem.DownloadInProgress) downloadFinishedSpy.wait() compare(totalBytes, receivedBytes) - compare(downloadState[2], WebEngineDownloadItem.DownloadCompleted) + tryCompare(downloadState, 2, WebEngineDownloadItem.DownloadCompleted) } function test_downloadCancelled() { diff --git a/tests/auto/quick/qmltests/data/tst_geopermission.qml b/tests/auto/quick/qmltests/data/tst_geopermission.qml index 1d4703e95..5e5e1a321 100644 --- a/tests/auto/quick/qmltests/data/tst_geopermission.qml +++ b/tests/auto/quick/qmltests/data/tst_geopermission.qml @@ -37,7 +37,7 @@ TestWebEngineView { property bool deniedGeolocation: false property bool geoPermissionRequested: false - property string consoleErrorMessage: "" + signal consoleErrorMessage(string message) SignalSpy { id: featurePermissionSpy @@ -45,6 +45,12 @@ TestWebEngineView { signalName: "featurePermissionRequested" } + SignalSpy { + id: consoleErrorMessageSpy + target: webEngineView + signalName: "consoleErrorMessage" + } + onFeaturePermissionRequested: { if (feature === WebEngineView.Geolocation) { geoPermissionRequested = true @@ -59,7 +65,7 @@ TestWebEngineView { onJavaScriptConsoleMessage: { if (level === WebEngineView.ErrorMessageLevel) - consoleErrorMessage = message + consoleErrorMessage(message) } TestCase { @@ -68,8 +74,8 @@ TestWebEngineView { function init() { deniedGeolocation = false - consoleErrorMessage = "" featurePermissionSpy.clear() + consoleErrorMessageSpy.clear() } function test_geoPermissionRequest() { @@ -78,15 +84,16 @@ TestWebEngineView { featurePermissionSpy.wait() verify(geoPermissionRequested) compare(featurePermissionSpy.count, 1) - if (consoleErrorMessage) // Print the error message if it fails to get user's location - fail(consoleErrorMessage) + if (consoleErrorMessageSpy.count) // Print the error message if it fails to get user's location + fail(consoleErrorMessageSpy.signalArguments[0][0]) } function test_deniedGeolocationByUser() { deniedGeolocation = true webEngineView.url = Qt.resolvedUrl("geolocation.html") featurePermissionSpy.wait() - compare(consoleErrorMessage, "User denied Geolocation") + consoleErrorMessageSpy.wait() + compare(consoleErrorMessageSpy.signalArguments[0][0], "User denied Geolocation") } } } diff --git a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro index cbd11cdca..9471def00 100644 --- a/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro +++ b/tests/auto/quick/qquickwebengineviewgraphics/qquickwebengineviewgraphics.pro @@ -1,3 +1,4 @@ include(../tests.pri) +CONFIG -= testcase # remove, once this passes in the CI exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc QT_PRIVATE += webengine-private diff --git a/tests/auto/quick/tests.pri b/tests/auto/quick/tests.pri index 56eee7199..3c56aef97 100644 --- a/tests/auto/quick/tests.pri +++ b/tests/auto/quick/tests.pri @@ -1,8 +1,6 @@ TEMPLATE = app -# FIXME: Re-enable once we want to run tests on the CI -# CONFIG += testcase - +CONFIG += testcase CONFIG += c++11 VPATH += $$_PRO_FILE_PWD_ diff --git a/tests/auto/widgets/positionplugin/positionplugin.pro b/tests/auto/widgets/positionplugin/positionplugin.pro index bca3e5756..6f2e736c6 100644 --- a/tests/auto/widgets/positionplugin/positionplugin.pro +++ b/tests/auto/widgets/positionplugin/positionplugin.pro @@ -1,12 +1,13 @@ TARGET = qtwebengine_positioning_testplugin -QT += positioning -PLUGIN_TYPE = position -PLUGIN_CLASS_NAME = TestPositionPlugin -PLUGIN_EXTENDS = - -load(qt_plugin) +QT += positioning SOURCES += plugin.cpp OTHER_FILES += \ plugin.json + +PLUGIN_TYPE = position +PLUGIN_CLASS_NAME = TestPositionPlugin +PLUGIN_EXTENDS = - +load(qt_plugin) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index cb0e2a5f4..270fd4458 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -128,7 +128,6 @@ private Q_SLOTS: void modified(); void contextMenuCrash(); void updatePositionDependentActionsCrash(); - void database(); void createPluginWithPluginsEnabled(); void createPluginWithPluginsDisabled(); void destroyPlugin_data(); @@ -214,9 +213,6 @@ private Q_SLOTS: void setHtmlWithBaseURL(); void setHtmlWithJSAlert(); void metaData(); -#if !defined(QT_NO_COMBOBOX) - void popupFocus(); -#endif void inputFieldFocus(); void hitTestContent(); void baseUrl_data(); @@ -794,64 +790,6 @@ void tst_QWebEnginePage::contextMenuCrash() #endif } -void tst_QWebEnginePage::database() -{ -#if !defined(QWEBENGINEDATABASE) - QSKIP("QWEBENGINEDATABASE"); -#else - QString path = tmpDirPath(); - m_page->settings()->setOfflineStoragePath(path); - QVERIFY(m_page->settings()->offlineStoragePath() == path); - - QWebEngineSettings::setOfflineStorageDefaultQuota(1024 * 1024); - QVERIFY(QWebEngineSettings::offlineStorageDefaultQuota() == 1024 * 1024); - - m_page->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true); - m_page->settings()->setAttribute(QWebEngineSettings::OfflineStorageDatabaseEnabled, true); - - QString dbFileName = path + "Databases.db"; - - if (QFile::exists(dbFileName)) - QFile::remove(dbFileName); - - qRegisterMetaType<QWebEngineFrame*>("QWebEngineFrame*"); - QSignalSpy spy(m_page, SIGNAL(databaseQuotaExceeded(QWebEngineFrame*,QString))); - m_view->setHtml(QString("<html><head><script>var db; db=openDatabase('testdb', '1.0', 'test database API', 50000); </script></head><body><div></div></body></html>"), QUrl("http://www.myexample.com")); - QTRY_COMPARE(spy.count(), 1); - evaluateJavaScriptSync(m_page, "var db2; db2=openDatabase('testdb', '1.0', 'test database API', 50000);"); - QTRY_COMPARE(spy.count(),1); - - evaluateJavaScriptSync(m_page, "localStorage.test='This is a test for local storage';"); - m_view->setHtml(QString("<html><body id='b'>text</body></html>"), QUrl("http://www.myexample.com")); - - QVariant s1 = evaluateJavaScriptSync(m_page, "localStorage.test"); - QCOMPARE(s1.toString(), QString("This is a test for local storage")); - - evaluateJavaScriptSync(m_page, "sessionStorage.test='This is a test for session storage';"); - m_view->setHtml(QString("<html><body id='b'>text</body></html>"), QUrl("http://www.myexample.com")); - QVariant s2 = evaluateJavaScriptSync(m_page, "sessionStorage.test"); - QCOMPARE(s2.toString(), QString("This is a test for session storage")); - - m_view->setHtml(QString("<html><head></head><body><div></div></body></html>"), QUrl("http://www.myexample.com")); - evaluateJavaScriptSync(m_page, "var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });"); - QTest::qWait(200); - - // Remove all databases. - QWebEngineSecurityOrigin origin = m_page->mainFrame()->securityOrigin(); - QList<QWebEngineDatabase> dbs = origin.databases(); - for (int i = 0; i < dbs.count(); i++) { - QString fileName = dbs[i].fileName(); - QVERIFY(QFile::exists(fileName)); - QWebEngineDatabase::removeDatabase(dbs[i]); - QVERIFY(!QFile::exists(fileName)); - } - QVERIFY(!origin.databases().size()); - // Remove removed test :-) - QWebEngineDatabase::removeAllDatabases(); - QVERIFY(!origin.databases().size()); -#endif -} - #if defined(QWEBENGINEPAGE_CREATEPLUGIN) class PluginPage : public QWebEnginePage { @@ -4202,49 +4140,6 @@ void tst_QWebEnginePage::metaData() #endif } -#if !defined(QT_NO_COMBOBOX) -void tst_QWebEnginePage::popupFocus() -{ -#if !defined(QWEBENGINEELEMENT) - QSKIP("QWEBENGINEELEMENT"); -#else - QWebEngineView view; - view.setHtml("<html>" - " <body>" - " <select name=\"select\">" - " <option>1</option>" - " <option>2</option>" - " </select>" - " <input type=\"text\"> </input>" - " <textarea name=\"text_area\" rows=\"3\" cols=\"40\">" - "This test checks whether showing and hiding a popup" - "takes the focus away from the webpage." - " </textarea>" - " </body>" - "</html>"); - view.resize(400, 100); - // Call setFocus before show to work around http://bugreports.qt.nokia.com/browse/QTBUG-14762 - view.setFocus(); - view.show(); - QTest::qWaitForWindowExposed(&view); - view.activateWindow(); - QTRY_VERIFY(view.hasFocus()); - - // open the popup by clicking. check if focus is on the popup - const QWebEngineElement webCombo = view.page()->documentElement().findFirst(QLatin1String("select[name=select]")); - QTest::mouseClick(&view, Qt::LeftButton, 0, webCombo.geometry().center()); - - QComboBox* combo = view.findChild<QComboBox*>(); - QVERIFY(combo != 0); - QTRY_VERIFY(!view.hasFocus() && combo->view()->hasFocus()); // Focus should be on the popup - - // hide the popup and check if focus is on the page - combo->hidePopup(); - QTRY_VERIFY(view.hasFocus()); // Focus should be back on the WebView -#endif -} -#endif - void tst_QWebEnginePage::inputFieldFocus() { #if !defined(QWEBENGINEELEMENT) |