From 9464e7f4646ce4bdc8e16c1716bf07345531db28 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 16 Nov 2016 12:53:06 +0100 Subject: Remove new API added in 5.7 Return the API to what it was in 5.6 Change-Id: I25e7f321802cfd69017120d5645e93c6e0d2fd32 Reviewed-by: Peter Varga Reviewed-by: Joerg Bornemann --- tests/auto/quick/publicapi/tst_publicapi.cpp | 168 -------- .../auto/quick/qmltests/data/TestWebEngineView.qml | 2 +- .../qmltests/data/favicon-candidates-gray.html | 29 -- tests/auto/quick/qmltests/data/favicon-misc.html | 11 - .../quick/qmltests/data/favicon-multi-gray.html | 25 -- tests/auto/quick/qmltests/data/favicon-multi.html | 9 - .../auto/quick/qmltests/data/favicon-shortcut.html | 10 - tests/auto/quick/qmltests/data/favicon-single.html | 9 - tests/auto/quick/qmltests/data/favicon-touch.html | 10 - .../quick/qmltests/data/favicon-unavailable.html | 9 - tests/auto/quick/qmltests/data/test4.html | 11 - tests/auto/quick/qmltests/data/tst_favIconLoad.qml | 105 +++++ tests/auto/quick/qmltests/data/tst_favicon.qml | 328 -------------- .../quick/qmltests/data/tst_faviconDownload.qml | 120 ------ .../qmltests/data/tst_keyboardModifierMapping.qml | 44 +- .../auto/quick/qmltests/data/tst_runJavaScript.qml | 1 - .../quick/qmltests/data/tst_scrollPosition.qml | 85 ---- tests/auto/quick/qmltests/qmltests.pro | 21 +- .../tst_qquickwebengineview.cpp | 22 - .../qwebenginefaviconmanager.pro | 1 - .../resources/favicon-misc.html | 11 - .../resources/favicon-multi.html | 9 - .../resources/favicon-shortcut.html | 10 - .../resources/favicon-single.html | 9 - .../resources/favicon-touch.html | 10 - .../resources/favicon-unavailable.html | 9 - .../resources/icons/qt144.png | Bin 8315 -> 0 bytes .../resources/icons/qt32.ico | Bin 4286 -> 0 bytes .../resources/icons/qtmulti.ico | Bin 22382 -> 0 bytes .../qwebenginefaviconmanager/resources/test1.html | 1 - .../tst_qwebenginefaviconmanager.cpp | 478 --------------------- .../tst_qwebenginefaviconmanager.qrc | 14 - .../widgets/qwebenginepage/tst_qwebenginepage.cpp | 37 +- tests/auto/widgets/qwebengineprofile/BLACKLIST | 5 - .../qwebengineprofile/tst_qwebengineprofile.cpp | 73 ---- .../qwebenginescript/tst_qwebenginescript.cpp | 8 +- .../widgets/qwebenginespellcheck/dict/en-US.aff | 5 - .../widgets/qwebenginespellcheck/dict/en-US.dic | 11 - .../qwebenginespellcheck/qwebenginespellcheck.pro | 22 - .../qwebenginespellcheck/resources/index.html | 36 -- .../tst_qwebenginespellcheck.cpp | 178 -------- .../tst_qwebenginespellcheck.qrc | 5 - .../resources/basic_printing_page.html | 8 - .../widgets/qwebengineview/tst_qwebengineview.qrc | 1 - tests/auto/widgets/util.h | 7 - tests/auto/widgets/widgets.pro | 6 - 46 files changed, 127 insertions(+), 1846 deletions(-) delete mode 100644 tests/auto/quick/qmltests/data/favicon-candidates-gray.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-misc.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-multi-gray.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-multi.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-shortcut.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-single.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-touch.html delete mode 100644 tests/auto/quick/qmltests/data/favicon-unavailable.html create mode 100644 tests/auto/quick/qmltests/data/tst_favIconLoad.qml delete mode 100644 tests/auto/quick/qmltests/data/tst_favicon.qml delete mode 100644 tests/auto/quick/qmltests/data/tst_faviconDownload.qml delete mode 100644 tests/auto/quick/qmltests/data/tst_scrollPosition.qml delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp delete mode 100644 tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc delete mode 100644 tests/auto/widgets/qwebengineprofile/BLACKLIST delete mode 100644 tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff delete mode 100644 tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic delete mode 100644 tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro delete mode 100644 tests/auto/widgets/qwebenginespellcheck/resources/index.html delete mode 100644 tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp delete mode 100644 tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc delete mode 100644 tests/auto/widgets/qwebengineview/resources/basic_printing_page.html (limited to 'tests') diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 1937dca04..47d44cd7f 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -76,7 +76,6 @@ static QStringList hardcodedTypes = QStringList() // Ignore the testSupport types without making a fuss. << "QQuickWebEngineTestSupport*" << "QQuickWebEngineErrorPage*" - << "const QQuickWebEngineContextMenuData*" << "QWebEngineCookieStore*" ; @@ -202,155 +201,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineView.grantFeaturePermission(QUrl,Feature,bool) --> void" << "QQuickWebEngineView.setActiveFocusOnPress(bool) --> void" << "QQuickWebEngineView.triggerWebAction(WebAction) --> void" - << "QQuickWebEngineView.Unselect --> WebAction" - << "QQuickWebEngineView.SavePage --> WebAction" - << "QQuickWebEngineView.A4 --> PrintedPageSizeId" - << "QQuickWebEngineView.B5 --> PrintedPageSizeId" - << "QQuickWebEngineView.Letter --> PrintedPageSizeId" - << "QQuickWebEngineView.Legal --> PrintedPageSizeId" - << "QQuickWebEngineView.Executive --> PrintedPageSizeId" - << "QQuickWebEngineView.A0 --> PrintedPageSizeId" - << "QQuickWebEngineView.A1 --> PrintedPageSizeId" - << "QQuickWebEngineView.A2 --> PrintedPageSizeId" - << "QQuickWebEngineView.A3 --> PrintedPageSizeId" - << "QQuickWebEngineView.A5 --> PrintedPageSizeId" - << "QQuickWebEngineView.A6 --> PrintedPageSizeId" - << "QQuickWebEngineView.A7 --> PrintedPageSizeId" - << "QQuickWebEngineView.A8 --> PrintedPageSizeId" - << "QQuickWebEngineView.A9 --> PrintedPageSizeId" - << "QQuickWebEngineView.B0 --> PrintedPageSizeId" - << "QQuickWebEngineView.B1 --> PrintedPageSizeId" - << "QQuickWebEngineView.B10 --> PrintedPageSizeId" - << "QQuickWebEngineView.B2 --> PrintedPageSizeId" - << "QQuickWebEngineView.B3 --> PrintedPageSizeId" - << "QQuickWebEngineView.B4 --> PrintedPageSizeId" - << "QQuickWebEngineView.B6 --> PrintedPageSizeId" - << "QQuickWebEngineView.B7 --> PrintedPageSizeId" - << "QQuickWebEngineView.B8 --> PrintedPageSizeId" - << "QQuickWebEngineView.B9 --> PrintedPageSizeId" - << "QQuickWebEngineView.C5E --> PrintedPageSizeId" - << "QQuickWebEngineView.Comm10E --> PrintedPageSizeId" - << "QQuickWebEngineView.DLE --> PrintedPageSizeId" - << "QQuickWebEngineView.Folio --> PrintedPageSizeId" - << "QQuickWebEngineView.Ledger --> PrintedPageSizeId" - << "QQuickWebEngineView.Tabloid --> PrintedPageSizeId" - << "QQuickWebEngineView.Custom --> PrintedPageSizeId" - << "QQuickWebEngineView.A10 --> PrintedPageSizeId" - << "QQuickWebEngineView.A3Extra --> PrintedPageSizeId" - << "QQuickWebEngineView.A4Extra --> PrintedPageSizeId" - << "QQuickWebEngineView.A4Plus --> PrintedPageSizeId" - << "QQuickWebEngineView.A4Small --> PrintedPageSizeId" - << "QQuickWebEngineView.A5Extra --> PrintedPageSizeId" - << "QQuickWebEngineView.B5Extra --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB0 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB1 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB2 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB3 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB4 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB5 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB6 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB7 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB8 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB9 --> PrintedPageSizeId" - << "QQuickWebEngineView.JisB10 --> PrintedPageSizeId" - << "QQuickWebEngineView.AnsiC --> PrintedPageSizeId" - << "QQuickWebEngineView.AnsiD --> PrintedPageSizeId" - << "QQuickWebEngineView.AnsiE --> PrintedPageSizeId" - << "QQuickWebEngineView.LegalExtra --> PrintedPageSizeId" - << "QQuickWebEngineView.LetterExtra --> PrintedPageSizeId" - << "QQuickWebEngineView.LetterPlus --> PrintedPageSizeId" - << "QQuickWebEngineView.LetterSmall --> PrintedPageSizeId" - << "QQuickWebEngineView.TabloidExtra --> PrintedPageSizeId" - << "QQuickWebEngineView.ArchA --> PrintedPageSizeId" - << "QQuickWebEngineView.ArchB --> PrintedPageSizeId" - << "QQuickWebEngineView.ArchC --> PrintedPageSizeId" - << "QQuickWebEngineView.ArchD --> PrintedPageSizeId" - << "QQuickWebEngineView.ArchE --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial7x9 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial8x10 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial9x11 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial9x12 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial10x11 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial10x13 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial10x14 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial12x11 --> PrintedPageSizeId" - << "QQuickWebEngineView.Imperial15x11 --> PrintedPageSizeId" - << "QQuickWebEngineView.ExecutiveStandard --> PrintedPageSizeId" - << "QQuickWebEngineView.Note --> PrintedPageSizeId" - << "QQuickWebEngineView.Quarto --> PrintedPageSizeId" - << "QQuickWebEngineView.Statement --> PrintedPageSizeId" - << "QQuickWebEngineView.SuperA --> PrintedPageSizeId" - << "QQuickWebEngineView.SuperB --> PrintedPageSizeId" - << "QQuickWebEngineView.Postcard --> PrintedPageSizeId" - << "QQuickWebEngineView.DoublePostcard --> PrintedPageSizeId" - << "QQuickWebEngineView.Prc16K --> PrintedPageSizeId" - << "QQuickWebEngineView.Prc32K --> PrintedPageSizeId" - << "QQuickWebEngineView.Prc32KBig --> PrintedPageSizeId" - << "QQuickWebEngineView.FanFoldUS --> PrintedPageSizeId" - << "QQuickWebEngineView.FanFoldGerman --> PrintedPageSizeId" - << "QQuickWebEngineView.FanFoldGermanLegal --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeB4 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeB5 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeB6 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC0 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC1 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC2 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC3 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC4 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC6 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC65 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC7 --> PrintedPageSizeId" - << "QQuickWebEngineView.Envelope9 --> PrintedPageSizeId" - << "QQuickWebEngineView.Envelope11 --> PrintedPageSizeId" - << "QQuickWebEngineView.Envelope12 --> PrintedPageSizeId" - << "QQuickWebEngineView.Envelope14 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeMonarch --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePersonal --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeChou3 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeChou4 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeInvite --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeItalian --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeKaku2 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeKaku3 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc1 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc2 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc3 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc4 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc5 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc6 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc7 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc8 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc9 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopePrc10 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeYou4 --> PrintedPageSizeId" - << "QQuickWebEngineView.LastPageSize --> PrintedPageSizeId" - << "QQuickWebEngineView.NPageSize --> PrintedPageSizeId" - << "QQuickWebEngineView.NPaperSize --> PrintedPageSizeId" - << "QQuickWebEngineView.AnsiA --> PrintedPageSizeId" - << "QQuickWebEngineView.AnsiB --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeC5 --> PrintedPageSizeId" - << "QQuickWebEngineView.EnvelopeDL --> PrintedPageSizeId" - << "QQuickWebEngineView.Envelope10 --> PrintedPageSizeId" - << "QQuickWebEngineView.Portrait --> PrintedPageOrientation" - << "QQuickWebEngineView.Landscape --> PrintedPageOrientation" - << "QQuickWebEngineView.contentsSize --> QSizeF" - << "QQuickWebEngineView.scrollPosition --> QPointF" - << "QQuickWebEngineView.audioMuted --> bool" - << "QQuickWebEngineView.recentlyAudible --> bool" - << "QQuickWebEngineView.webChannelWorld --> uint" - << "QQuickWebEngineView.contentsSizeChanged(QSizeF) --> void" - << "QQuickWebEngineView.scrollPositionChanged(QPointF) --> void" - << "QQuickWebEngineView.audioMutedChanged(bool) --> void" - << "QQuickWebEngineView.recentlyAudibleChanged(bool) --> void" - << "QQuickWebEngineView.webChannelWorldChanged(uint) --> void" - << "QQuickWebEngineView.runJavaScript(QString,uint,QJSValue) --> void" - << "QQuickWebEngineView.runJavaScript(QString,uint) --> void" - << "QQuickWebEngineView.printToPdf(QString,PrintedPageSizeId,PrintedPageOrientation) --> void" - << "QQuickWebEngineView.printToPdf(QString,PrintedPageSizeId) --> void" - << "QQuickWebEngineView.printToPdf(QString) --> void" - << "QQuickWebEngineView.printToPdf(QJSValue,PrintedPageSizeId,PrintedPageOrientation) --> void" - << "QQuickWebEngineView.printToPdf(QJSValue,PrintedPageSizeId) --> void" - << "QQuickWebEngineView.printToPdf(QJSValue) --> void" << "QQuickWebEngineCertificateError.SslPinnedKeyNotInCertificateChain --> Error" << "QQuickWebEngineCertificateError.CertificateCommonNameInvalid --> Error" << "QQuickWebEngineCertificateError.CertificateDateInvalid --> Error" @@ -364,7 +214,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineCertificateError.CertificateNonUniqueName --> Error" << "QQuickWebEngineCertificateError.CertificateWeakKey --> Error" << "QQuickWebEngineCertificateError.CertificateNameConstraintViolation --> Error" - << "QQuickWebEngineCertificateError.CertificateValidityTooLong --> Error" << "QQuickWebEngineCertificateError.url --> QUrl" << "QQuickWebEngineCertificateError.error --> Error" << "QQuickWebEngineCertificateError.description --> QString" @@ -390,12 +239,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineDownloadItem.pathChanged() --> void" << "QQuickWebEngineDownloadItem.accept() --> void" << "QQuickWebEngineDownloadItem.cancel() --> void" - << "QQuickWebEngineDownloadItem.UnknownSaveFormat --> SavePageFormat" - << "QQuickWebEngineDownloadItem.SingleHtmlSaveFormat --> SavePageFormat" - << "QQuickWebEngineDownloadItem.CompleteHtmlSaveFormat --> SavePageFormat" - << "QQuickWebEngineDownloadItem.MimeHtmlSaveFormat --> SavePageFormat" - << "QQuickWebEngineDownloadItem.savePageFormat --> SavePageFormat" - << "QQuickWebEngineDownloadItem.savePageFormatChanged() --> void" << "QQuickWebEngineHistory.items --> QQuickWebEngineHistoryListModel*" << "QQuickWebEngineHistory.backItems --> QQuickWebEngineHistoryListModel*" << "QQuickWebEngineHistory.forwardItems --> QQuickWebEngineHistoryListModel*" @@ -437,7 +280,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void" << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void" << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void" - << "QQuickWebEngineProfile.NoCache --> HttpCacheType" << "QQuickWebEngineScript.Deferred --> InjectionPoint" << "QQuickWebEngineScript.DocumentReady --> InjectionPoint" << "QQuickWebEngineScript.DocumentCreation --> InjectionPoint" @@ -491,16 +333,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineSettings.pluginsEnabledChanged() --> void" << "QQuickWebEngineSettings.fullScreenSupportEnabledChanged() --> void" << "QQuickWebEngineSettings.defaultTextEncodingChanged() --> void" - << "QQuickWebEngineSettings.screenCaptureEnabled --> bool" - << "QQuickWebEngineSettings.webGLEnabled --> bool" - << "QQuickWebEngineSettings.accelerated2dCanvasEnabled --> bool" - << "QQuickWebEngineSettings.autoLoadIconsForPage --> bool" - << "QQuickWebEngineSettings.touchIconsEnabled --> bool" - << "QQuickWebEngineSettings.screenCaptureEnabledChanged() --> void" - << "QQuickWebEngineSettings.webGLEnabledChanged() --> void" - << "QQuickWebEngineSettings.accelerated2dCanvasEnabledChanged() --> void" - << "QQuickWebEngineSettings.autoLoadIconsForPageChanged() --> void" - << "QQuickWebEngineSettings.touchIconsEnabledChanged() --> void" << "QQuickWebEngineFullScreenRequest.origin --> QUrl" << "QQuickWebEngineFullScreenRequest.toggleOn --> bool" << "QQuickWebEngineFullScreenRequest.accept() --> void" diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml index 0d2a34645..34fc5fb2f 100644 --- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml +++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml @@ -28,7 +28,7 @@ import QtQuick 2.0 import QtTest 1.0 -import QtWebEngine 1.3 +import QtWebEngine 1.2 WebEngineView { property var loadStatus: null diff --git a/tests/auto/quick/qmltests/data/favicon-candidates-gray.html b/tests/auto/quick/qmltests/data/favicon-candidates-gray.html deleted file mode 100644 index 3cbc4a4c3..000000000 --- a/tests/auto/quick/qmltests/data/favicon-candidates-gray.html +++ /dev/null @@ -1,29 +0,0 @@ - - - Gray Candidate Favicons Test - - - - - - - -

Gray Candidate Favicons Test

- - - - - - - - - - - - - - - -
16x1632x3264x64128x128255x255
- - diff --git a/tests/auto/quick/qmltests/data/favicon-misc.html b/tests/auto/quick/qmltests/data/favicon-misc.html deleted file mode 100644 index 9e788bdf4..000000000 --- a/tests/auto/quick/qmltests/data/favicon-misc.html +++ /dev/null @@ -1,11 +0,0 @@ - - - Favicon Test - - - - - -

Favicon Test

- - diff --git a/tests/auto/quick/qmltests/data/favicon-multi-gray.html b/tests/auto/quick/qmltests/data/favicon-multi-gray.html deleted file mode 100644 index 9b9b7432d..000000000 --- a/tests/auto/quick/qmltests/data/favicon-multi-gray.html +++ /dev/null @@ -1,25 +0,0 @@ - - - Gray Multi-sized Favicon Test - - - -

Gray Multi-sized Favicon Test

- - - - - - - - - - - - - - - -
16x1632x3264x64128x128255x255
- - diff --git a/tests/auto/quick/qmltests/data/favicon-multi.html b/tests/auto/quick/qmltests/data/favicon-multi.html deleted file mode 100644 index cc5f3fd66..000000000 --- a/tests/auto/quick/qmltests/data/favicon-multi.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Multi-sized Favicon Test - - - -

Multi-sized Favicon Test

- - diff --git a/tests/auto/quick/qmltests/data/favicon-shortcut.html b/tests/auto/quick/qmltests/data/favicon-shortcut.html deleted file mode 100644 index 786cdb816..000000000 --- a/tests/auto/quick/qmltests/data/favicon-shortcut.html +++ /dev/null @@ -1,10 +0,0 @@ - - - Favicon Test - - - - -

Favicon Test

- - diff --git a/tests/auto/quick/qmltests/data/favicon-single.html b/tests/auto/quick/qmltests/data/favicon-single.html deleted file mode 100644 index eb4675c75..000000000 --- a/tests/auto/quick/qmltests/data/favicon-single.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Favicon Test - - - -

Favicon Test

- - diff --git a/tests/auto/quick/qmltests/data/favicon-touch.html b/tests/auto/quick/qmltests/data/favicon-touch.html deleted file mode 100644 index 271783434..000000000 --- a/tests/auto/quick/qmltests/data/favicon-touch.html +++ /dev/null @@ -1,10 +0,0 @@ - - - Favicon Test - - - - -

Favicon Test

- - diff --git a/tests/auto/quick/qmltests/data/favicon-unavailable.html b/tests/auto/quick/qmltests/data/favicon-unavailable.html deleted file mode 100644 index c45664294..000000000 --- a/tests/auto/quick/qmltests/data/favicon-unavailable.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Favicon Test - - - -

Favicon Test

- - diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html index 142b53668..8f75af606 100644 --- a/tests/auto/quick/qmltests/data/test4.html +++ b/tests/auto/quick/qmltests/data/test4.html @@ -12,17 +12,6 @@ -

- -
bla00
bla01
diff --git a/tests/auto/quick/qmltests/data/tst_favIconLoad.qml b/tests/auto/quick/qmltests/data/tst_favIconLoad.qml new file mode 100644 index 000000000..df5479eec --- /dev/null +++ b/tests/auto/quick/qmltests/data/tst_favIconLoad.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtTest 1.0 +import QtWebEngine 1.2 + +TestWebEngineView { + id: webEngineView + width: 200 + height: 400 + + SignalSpy { + id: spy + target: webEngineView + signalName: "iconChanged" + } + + // FIXME: This test is flaky if the loading of the icon image is asynchronous, + // because the iconChanged signal is emitted before the image has been downloaded. + // We can set this property to true after we have some kind of favicon downloading + // logic in the WebEngine. + + Image { + id: favicon + asynchronous: false + source: webEngineView.icon + } + + TestCase { + id: test + name: "WebEngineViewLoadFavIcon" + when: windowShown + + function init() { + if (webEngineView.icon != '') { + // If this is not the first test, then load a blank page without favicon, restoring the initial state. + webEngineView.url = 'about:blank' + verify(webEngineView.waitForLoadSucceeded()) + spy.wait() + } + spy.clear() + } + + function test_favIconLoad() { + compare(spy.count, 0) + var url = Qt.resolvedUrl("favicon.html") + webEngineView.url = url + verify(webEngineView.waitForLoadSucceeded()) + spy.wait() + compare(spy.count, 1) + compare(favicon.width, 48) + compare(favicon.height, 48) + } + + function test_favIconLoadEncodedUrl() { + compare(spy.count, 0) + var url = Qt.resolvedUrl("favicon2.html?favicon=load should work with#whitespace!") + webEngineView.url = url + verify(webEngineView.waitForLoadSucceeded()) + spy.wait() + compare(spy.count, 1) + compare(favicon.width, 16) + compare(favicon.height, 16) + } + } +} diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml deleted file mode 100644 index f8ad998ef..000000000 --- a/tests/auto/quick/qmltests/data/tst_favicon.qml +++ /dev/null @@ -1,328 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtTest 1.0 -import QtWebEngine 1.3 -import QtWebEngine.testsupport 1.0 - -TestWebEngineView { - id: webEngineView - width: 200 - height: 400 - - testSupport: WebEngineTestSupport { - property var errorPageLoadStatus: null - - function waitForErrorPageLoadSucceeded() { - var success = _waitFor(function() { return testSupport.errorPageLoadStatus == WebEngineView.LoadSucceededStatus }) - testSupport.errorPageLoadStatus = null - return success - } - - errorPage.onLoadingChanged: { - errorPageLoadStatus = loadRequest.status - } - } - - function removeFaviconProviderPrefix(url) { - return url.toString().substring(16) - } - - SignalSpy { - id: iconChangedSpy - target: webEngineView - signalName: "iconChanged" - } - - Image { - id: favicon - source: webEngineView.icon - } - - TestCase { - id: test - name: "WebEngineFavicon" - when: windowShown - - - function init() { - // It is worth to restore the initial state with loading a blank page before all test functions. - webEngineView.url = 'about:blank' - verify(webEngineView.waitForLoadSucceeded()) - iconChangedSpy.clear() - } - - function test_faviconLoad() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("favicon.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - compare(iconChangedSpy.count, 1) - - compare(favicon.width, 48) - compare(favicon.height, 48) - } - - function test_faviconLoadEncodedUrl() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("favicon2.html?favicon=load should work with#whitespace!") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - compare(iconChangedSpy.count, 1) - - compare(favicon.width, 16) - compare(favicon.height, 16) - } - - function test_noFavicon() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("test1.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - } - - function test_aboutBlank() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("about:blank") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - } - - function test_unavailableFavicon() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("favicon-unavailable.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - } - - function test_errorPageEnabled() { - WebEngine.settings.errorPageEnabled = true - - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("invalid://url") - webEngineView.url = url - verify(webEngineView.testSupport.waitForErrorPageLoadSucceeded()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - } - - function test_errorPageDisabled() { - WebEngine.settings.errorPageEnabled = false - - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("invalid://url") - webEngineView.url = url - verify(webEngineView.waitForLoadFailed()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - } - - function test_bestFavicon() { - compare(iconChangedSpy.count, 0) - var url, iconUrl - - url = Qt.resolvedUrl("favicon-misc.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - compare(iconChangedSpy.count, 1) - - iconUrl = removeFaviconProviderPrefix(webEngineView.icon) - // Touch icon is ignored - compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico")) - compare(favicon.width, 32) - compare(favicon.height, 32) - - iconChangedSpy.clear() - - url = Qt.resolvedUrl("favicon-shortcut.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - verify(iconChangedSpy.count >= 1) - iconUrl = removeFaviconProviderPrefix(webEngineView.icon) - - // If the icon URL is empty we have to wait for - // the second iconChanged signal that propagates the expected URL - if (iconUrl == Qt.resolvedUrl("")) { - tryCompare(iconChangedSpy, "count", 2) - iconUrl = removeFaviconProviderPrefix(webEngineView.icon) - } - - compare(iconUrl, Qt.resolvedUrl("icons/qt144.png")) - compare(favicon.width, 144) - compare(favicon.height, 144) - } - - function test_touchIcon() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("favicon-touch.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - compare(favicon.width, 0) - compare(favicon.height, 0) - - WebEngine.settings.touchIconsEnabled = true - - url = Qt.resolvedUrl("favicon-touch.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - iconUrl = removeFaviconProviderPrefix(webEngineView.icon) - compare(iconUrl, Qt.resolvedUrl("icons/qt144.png")) - compare(iconChangedSpy.count, 1) - compare(favicon.width, 144) - compare(favicon.height, 144) - } - - function test_multiIcon() { - compare(iconChangedSpy.count, 0) - - var url = Qt.resolvedUrl("favicon-multi.html") - webEngineView.url = url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - compare(iconChangedSpy.count, 1) - compare(favicon.width, 64) - compare(favicon.height, 64) - } - - function test_faviconProvider_data() { - return [ - { tag: "multi 8x8", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 8, value: 16 }, - { tag: "multi 16x16", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 16, value: 16 }, - { tag: "multi 17x17", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 17, value: 32 }, - { tag: "multi 31x31", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 31, value: 32 }, - { tag: "multi 32x32", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 32, value: 32 }, - { tag: "multi 33x33", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 33, value: 64 }, - { tag: "multi 64x64", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 64, value: 64 }, - { tag: "multi 128x128", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 128, value: 128 }, - { tag: "multi 255x255", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 255, value: 255 }, - { tag: "multi 256x256", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 256, value: 255 }, - { tag: "candidate 8x8", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 8, value: 16 }, - { tag: "candidate 16x16", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 16, value: 16 }, - { tag: "candidate 17x17", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 17, value: 32 }, - { tag: "candidate 31x31", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 31, value: 32 }, - { tag: "candidate 32x32", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 32, value: 32 }, - { tag: "candidate 33x33", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 33, value: 64 }, - { tag: "candidate 64x64", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 64, value: 64 }, - { tag: "candidate 128x128", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 128, value: 128 }, - { tag: "candidate 255x255", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 255, value: 255 }, - { tag: "candidate 256x256", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 256, value: 255 }, - ]; - } - - function test_faviconProvider(row) { - var faviconImage = Qt.createQmlObject(" - import QtQuick 2.5\n - Image { sourceSize: Qt.size(width, height) }", test) - var grabImage = Qt.createQmlObject(" - import QtQuick 2.5\n - Image { }", test) - var faviconCanvas = Qt.createQmlObject(" - import QtQuick 2.5\n - Canvas { }", test) - - compare(iconChangedSpy.count, 0) - - webEngineView.url = row.url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - compare(iconChangedSpy.count, 1) - - faviconImage.width = row.size - faviconImage.height = row.size - faviconImage.source = webEngineView.icon - verify(_waitFor(function() { return faviconImage.status == Image.Ready } )) - - faviconImage.grabToImage(function(result) { - grabImage.source = result.url - }) - verify(_waitFor(function() { return grabImage.status == Image.Ready } )) - - faviconCanvas.width = faviconImage.width - faviconCanvas.height = faviconImage.height - var ctx = faviconCanvas.getContext("2d") - ctx.drawImage(grabImage, 0, 0, grabImage.width, grabImage.height) - - var center = Math.round(row.size/2) - var imageData = ctx.getImageData(center, center, center, center) - var pixel = imageData.data - - compare(pixel[0], row.value) - - faviconImage.destroy() - grabImage.destroy() - faviconCanvas.destroy() - } - } -} diff --git a/tests/auto/quick/qmltests/data/tst_faviconDownload.qml b/tests/auto/quick/qmltests/data/tst_faviconDownload.qml deleted file mode 100644 index 406dfa3ea..000000000 --- a/tests/auto/quick/qmltests/data/tst_faviconDownload.qml +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtTest 1.0 -import QtWebEngine 1.3 - -TestWebEngineView { - id: webEngineView - width: 200 - height: 400 - - function removeFaviconProviderPrefix(url) { - return url.toString().substring(16) - } - - SignalSpy { - id: iconChangedSpy - target: webEngineView - signalName: "iconChanged" - } - - TestCase { - id: test - name: "WebEngineFaviconDownload" - - function init() { - WebEngine.settings.autoLoadIconsForPage = true - WebEngine.settings.touchIconsEnabled = false - - if (webEngineView.icon != '') { - // If this is not the first test, then load a blank page without favicon, restoring the initial state. - webEngineView.url = 'about:blank' - verify(webEngineView.waitForLoadSucceeded()) - iconChangedSpy.wait() - } - - iconChangedSpy.clear() - } - - function cleanupTestCase() { - WebEngine.settings.autoLoadIconsForPage = true - WebEngine.settings.touchIconsEnabled = false - } - - function test_downloadIconsDisabled_data() { - return [ - { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html") }, - { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html") }, - { tag: "single", url: Qt.resolvedUrl("favicon-single.html") }, - { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html") }, - { tag: "unavailable", url: Qt.resolvedUrl("favicon-unavailable.html") }, - ]; - } - - function test_downloadIconsDisabled(row) { - WebEngine.settings.autoLoadIconsForPage = false - - compare(iconChangedSpy.count, 0) - - webEngineView.url = row.url - verify(webEngineView.waitForLoadSucceeded()) - - compare(iconChangedSpy.count, 0) - - var iconUrl = webEngineView.icon - compare(iconUrl, Qt.resolvedUrl("")) - } - - function test_downloadTouchIconsEnabled_data() { - return [ - { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") }, - { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") }, - { tag: "single", url: Qt.resolvedUrl("favicon-single.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt32.ico") }, - { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") }, - ]; - } - - function test_downloadTouchIconsEnabled(row) { - WebEngine.settings.touchIconsEnabled = true - - compare(iconChangedSpy.count, 0) - - webEngineView.url = row.url - verify(webEngineView.waitForLoadSucceeded()) - - iconChangedSpy.wait() - compare(iconChangedSpy.count, 1) - - var iconUrl = removeFaviconProviderPrefix(webEngineView.icon) - compare(iconUrl, row.expectedIconUrl) - } - } -} - diff --git a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml index 86fb9281c..c50db7aa3 100644 --- a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml +++ b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml @@ -52,25 +52,27 @@ TestWebEngineView { onTriggered: parent.when = true } + function getPressedModifiers() { + var pressedModifiers; + runJavaScript("getPressedModifiers()", function(result) { + pressedModifiers = result; + }); + wait(200); + verify(function() { return pressedModifiers != undefined }); + return pressedModifiers; + } + function test_keyboardModifierMapping() { - skip("runJavaScript bug: QTBUG-51746") webEngineView.url = Qt.resolvedUrl("keyboardModifierMapping.html") waitForLoadSucceeded(); titleSpy.wait() - var callbackCalled = false; // Alt keyPress(Qt.Key_Alt); titleSpy.wait() - runJavaScript("getPressedModifiers()", function(result) { - compare(result, "alt:pressed ctrl:no meta:no"); - callbackCalled = true; - }); - wait(100); - verify(callbackCalled); + compare(getPressedModifiers(), "alt:pressed ctrl:no meta:no"); keyRelease(Qt.Key_Alt) titleSpy.wait() - callbackCalled = false; // Ctrl // On mac Qt automatically translates Meta to Ctrl and vice versa. @@ -79,36 +81,18 @@ TestWebEngineView { // For testing we assume that the flag Qt::AA_MacDontSwapCtrlAndMeta is NOT set. keyPress(Qt.platform.os == "osx" ? Qt.Key_Meta : Qt.Key_Control); titleSpy.wait() - runJavaScript("getPressedModifiers()", function(result) { - compare(result, "alt:released ctrl:pressed meta:no"); - callbackCalled = true; - }); - wait(100); - verify(callbackCalled); + compare(getPressedModifiers(), "alt:released ctrl:pressed meta:no"); keyRelease(Qt.platform.os == "osx" ? Qt.Key_Meta : Qt.Key_Control); titleSpy.wait() - callbackCalled = false; // Meta (Command on Mac) keyPress(Qt.platform.os == "osx" ? Qt.Key_Control : Qt.Key_Meta); titleSpy.wait() - runJavaScript("getPressedModifiers()", function(result) { - compare(result, "alt:released ctrl:released meta:pressed"); - callbackCalled = true; - }); - wait(100); - verify(callbackCalled); + compare(getPressedModifiers(), "alt:released ctrl:released meta:pressed"); keyRelease(Qt.platform.os == "osx" ? Qt.Key_Control : Qt.Key_Meta); titleSpy.wait() - callbackCalled = false; - runJavaScript("getPressedModifiers()", function(result) { - compare(result, "alt:released ctrl:released meta:released"); - callbackCalled = true; - }); - wait(100); - verify(callbackCalled); - callbackCalled = false; + compare(getPressedModifiers(), "alt:released ctrl:released meta:released"); } } } diff --git a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml index 2011d2a5c..beeebc049 100644 --- a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml +++ b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml @@ -44,7 +44,6 @@ TestWebEngineView { TestCase { name: "WebEngineViewRunJavaScript" function test_runJavaScript() { - skip("runJavaScript bug: QTBUG-51746") var testTitle = "Title to test runJavaScript"; runJavaScript("document.title = \"" + testTitle +"\""); _waitFor(function() { spy.count > 0; }); diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml deleted file mode 100644 index 55b71189d..000000000 --- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtTest 1.0 -import QtWebEngine 1.3 - -TestWebEngineView { - id: webEngineView - width: 300 - height: 400 - - property var testUrl: Qt.resolvedUrl("test4.html") - - SignalSpy { - id: scrollPositionSpy - target: webEngineView - signalName: "onScrollPositionChanged" - } - - TestCase { - name: "ScrollPosition" - when: windowShown - - function init() { - webEngineView.url = Qt.resolvedUrl("about:blank"); - verify(webEngineView.waitForLoadSucceeded()); - } - - function test_scrollPosition() { - webEngineView.url = testUrl; - verify(webEngineView.waitForLoadSucceeded()); - - keyPress(Qt.Key_Return); // Focus is on the scroll button. - - tryCompare(scrollPositionSpy, "count", 1); - compare(webEngineView.scrollPosition.x, 0); - compare(webEngineView.scrollPosition.y, 600); - } - - function test_scrollPositionAfterReload() { - webEngineView.url = testUrl; - verify(webEngineView.waitForLoadSucceeded()); - tryCompare(webEngineView.scrollPosition, "y", 0); - - keyPress(Qt.Key_Return); // Focus is on the scroll button. - - // Wait for proper scroll position change otherwise we cannot expect - // the new y position after reload. - tryCompare(webEngineView.scrollPosition, "x", 0); - tryCompare(webEngineView.scrollPosition, "y", 600); - - webEngineView.reload(); - verify(webEngineView.waitForLoadSucceeded()); - - tryCompare(webEngineView.scrollPosition, "x", 0); - tryCompare(webEngineView.scrollPosition, "y", 600); - } - } -} diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 0158a7268..db75586fc 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -16,14 +16,6 @@ OTHER_FILES += \ $$PWD/data/directoryupload.html \ $$PWD/data/favicon.html \ $$PWD/data/favicon2.html \ - $$PWD/data/favicon-candidates-gray.html \ - $$PWD/data/favicon-misc.html \ - $$PWD/data/favicon-multi.html \ - $$PWD/data/favicon-multi-gray.html \ - $$PWD/data/favicon-single.html \ - $$PWD/data/favicon-shortcut.html \ - $$PWD/data/favicon-touch.html \ - $$PWD/data/favicon-unavailable.html \ $$PWD/data/forms.html \ $$PWD/data/geolocation.html \ $$PWD/data/javascript.html \ @@ -42,8 +34,7 @@ OTHER_FILES += \ $$PWD/data/titleupdate.js \ $$PWD/data/tst_desktopBehaviorLoadHtml.qml \ $$PWD/data/tst_download.qml \ - $$PWD/data/tst_favicon.qml \ - $$PWD/data/tst_faviconDownload.qml \ + $$PWD/data/tst_favIconLoad.qml \ $$PWD/data/tst_filePicker.qml \ $$PWD/data/tst_formValidation.qml \ $$PWD/data/tst_geopermission.qml \ @@ -59,7 +50,6 @@ OTHER_FILES += \ $$PWD/data/tst_navigationRequested.qml \ $$PWD/data/tst_properties.qml \ $$PWD/data/tst_runJavaScript.qml \ - $$PWD/data/tst_scrollPosition.qml \ $$PWD/data/tst_titleChanged.qml \ $$PWD/data/tst_unhandledKeyEventPropagation.qml \ $$PWD/data/tst_userScripts.qml \ @@ -67,16 +57,7 @@ OTHER_FILES += \ $$PWD/data/tst_settings.qml \ $$PWD/data/tst_keyboardModifierMapping.qml \ $$PWD/data/icons/favicon.png \ - $$PWD/data/icons/gray128.png \ - $$PWD/data/icons/gray16.png \ - $$PWD/data/icons/gray255.png \ - $$PWD/data/icons/gray32.png \ - $$PWD/data/icons/gray64.png \ - $$PWD/data/icons/grayicons.ico \ $$PWD/data/icons/small-favicon.png \ - $$PWD/data/icons/qt144.png \ - $$PWD/data/icons/qt32.ico \ - $$PWD/data/icons/qtmulti.ico \ $$PWD/mock-delegates/QtWebEngine/UIDelegates/AlertDialog.qml \ $$PWD/mock-delegates/QtWebEngine/UIDelegates/ConfirmDialog.qml \ $$PWD/mock-delegates/QtWebEngine/UIDelegates/FilePicker.qml \ diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index b71b9dd08..419643b47 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -71,7 +71,6 @@ private Q_SLOTS: void inputMethodHints(); void basicRenderingSanity(); void setZoomFactor(); - void printToPdf(); void stopSettingFocusWhenDisabled(); void stopSettingFocusWhenDisabled_data(); void inputEventForwardingDisabledWhenActiveFocusOnPressDisabled(); @@ -494,27 +493,6 @@ void tst_QQuickWebEngineView::setZoomFactor() QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5)); } -void tst_QQuickWebEngineView::printToPdf() -{ - QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX"); - QVERIFY(tempDir.isValid()); - QQuickWebEngineView *view = webEngineView(); - view->setUrl(urlFromTestPath("html/basic_page.html")); - QVERIFY(waitForLoadSucceeded(view)); - - QString path = tempDir.path() + "/print_success.pdf"; - view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); - QTRY_VERIFY(QFile::exists(path)); - -#if !defined(Q_OS_WIN) - path = tempDir.path() + "/print_//fail.pdf"; -#else - path = tempDir.path() + "/print_|fail.pdf"; -#endif // #if !defined(Q_OS_WIN) - view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); - QTRY_VERIFY(!QFile::exists(path)); -} - void tst_QQuickWebEngineView::stopSettingFocusWhenDisabled() { QFETCH(bool, viewEnabled); diff --git a/tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro b/tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro deleted file mode 100644 index e99c7f493..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro +++ /dev/null @@ -1 +0,0 @@ -include(../tests.pri) diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html deleted file mode 100644 index 9e788bdf4..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html +++ /dev/null @@ -1,11 +0,0 @@ - - - Favicon Test - - - - - -

Favicon Test

- - diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html deleted file mode 100644 index cc5f3fd66..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Multi-sized Favicon Test - - - -

Multi-sized Favicon Test

- - diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html deleted file mode 100644 index 786cdb816..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html +++ /dev/null @@ -1,10 +0,0 @@ - - - Favicon Test - - - - -

Favicon Test

- - diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html deleted file mode 100644 index eb4675c75..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Favicon Test - - - -

Favicon Test

- - diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html deleted file mode 100644 index 271783434..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html +++ /dev/null @@ -1,10 +0,0 @@ - - - Favicon Test - - - - -

Favicon Test

- - diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html deleted file mode 100644 index c45664294..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Favicon Test - - - -

Favicon Test

- - diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png b/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png deleted file mode 100644 index 050b1e066..000000000 Binary files a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png and /dev/null differ diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico b/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico deleted file mode 100644 index 2f6fcb5bc..000000000 Binary files a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico and /dev/null differ diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico b/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico deleted file mode 100644 index 81e5a22e8..000000000 Binary files a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico and /dev/null differ diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html deleted file mode 100644 index b323f966e..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html +++ /dev/null @@ -1 +0,0 @@ -

Some text 1

diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp deleted file mode 100644 index 38311cad2..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "../util.h" - -#include -#include -#include - - -class tst_QWebEngineFaviconManager : public QObject { - Q_OBJECT - -public Q_SLOTS: - void init(); - void initTestCase(); - void cleanupTestCase(); - void cleanup(); - -private Q_SLOTS: - void faviconLoad(); - void faviconLoadFromResources(); - void faviconLoadEncodedUrl(); - void noFavicon(); - void aboutBlank(); - void unavailableFavicon(); - void errorPageEnabled(); - void errorPageDisabled(); - void bestFavicon(); - void touchIcon(); - void multiIcon(); - void candidateIcon(); - void downloadIconsDisabled_data(); - void downloadIconsDisabled(); - void downloadTouchIconsEnabled_data(); - void downloadTouchIconsEnabled(); - -private: - QWebEngineView *m_view; - QWebEnginePage *m_page; -}; - - -void tst_QWebEngineFaviconManager::init() -{ - m_view = new QWebEngineView(); - m_page = m_view->page(); -} - - -void tst_QWebEngineFaviconManager::initTestCase() -{ -} - -void tst_QWebEngineFaviconManager::cleanupTestCase() -{ -} - - -void tst_QWebEngineFaviconManager::cleanup() -{ - delete m_view; -} - -void tst_QWebEngineFaviconManager::faviconLoad() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-single.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(iconUrl, m_page->iconUrl()); - QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt32.ico"))); - - const QIcon &icon = m_page->icon(); - QVERIFY(!icon.isNull()); - - QCOMPARE(icon.availableSizes().count(), 1); - QSize iconSize = icon.availableSizes().first(); - QCOMPARE(iconSize, QSize(32, 32)); -} - -void tst_QWebEngineFaviconManager::faviconLoadFromResources() -{ - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url("qrc:/resources/favicon-single.html"); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(iconUrl, m_page->iconUrl()); - QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico")); - - const QIcon &icon = m_page->icon(); - QVERIFY(!icon.isNull()); - - QCOMPARE(icon.availableSizes().count(), 1); - QSize iconSize = icon.availableSizes().first(); - QCOMPARE(iconSize, QSize(32, 32)); -} - -void tst_QWebEngineFaviconManager::faviconLoadEncodedUrl() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QString urlString = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-single.html")).toString(); - QUrl url(urlString + QLatin1String("?favicon=load should work with#whitespace!")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(m_page->iconUrl(), iconUrl); - QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt32.ico"))); - - const QIcon &icon = m_page->icon(); - QVERIFY(!icon.isNull()); - - QCOMPARE(icon.availableSizes().count(), 1); - QSize iconSize = icon.availableSizes().first(); - QCOMPARE(iconSize, QSize(32, 32)); -} - -void tst_QWebEngineFaviconManager::noFavicon() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/test1.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::aboutBlank() -{ - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url("about:blank"); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::unavailableFavicon() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-unavailable.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::errorPageEnabled() -{ - m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url("invalid://url"); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::errorPageDisabled() -{ - m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url("invalid://url"); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::bestFavicon() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url, iconUrl; - QIcon icon; - QSize iconSize; - - url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-misc.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(iconUrl, m_page->iconUrl()); - // Touch icon is ignored - QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt32.ico"))); - - icon = m_page->icon(); - QVERIFY(!icon.isNull()); - - QCOMPARE(icon.availableSizes().count(), 1); - iconSize = icon.availableSizes().first(); - QCOMPARE(iconSize, QSize(32, 32)); - - loadFinishedSpy.clear(); - iconUrlChangedSpy.clear(); - iconChangedSpy.clear(); - - url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-shortcut.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_VERIFY(iconUrlChangedSpy.count() >= 1); - QTRY_VERIFY(iconChangedSpy.count() >= 1); - - iconUrl = iconUrlChangedSpy.last().at(0).toString(); - - // If the icon URL is empty we have to wait for - // the second iconChanged signal that propagates the expected URL - if (iconUrl.isEmpty()) { - QTRY_COMPARE(iconUrlChangedSpy.count(), 2); - QTRY_COMPARE(iconChangedSpy.count(), 2); - iconUrl = iconUrlChangedSpy.last().at(0).toString(); - } - - QCOMPARE(iconUrl, m_page->iconUrl()); - QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt144.png"))); - - icon = m_page->icon(); - QVERIFY(!icon.isNull()); - - QVERIFY(icon.availableSizes().count() >= 1); - QVERIFY(icon.availableSizes().contains(QSize(144, 144))); -} - -void tst_QWebEngineFaviconManager::touchIcon() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-touch.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::multiIcon() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-multi.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(m_page->iconUrl(), iconUrl); - QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qtmulti.ico"))); - - const QIcon &icon = m_page->icon(); - QVERIFY(!icon.isNull()); - QCOMPARE(icon.availableSizes().count(), 3); - QVERIFY(icon.availableSizes().contains(QSize(16, 16))); - QVERIFY(icon.availableSizes().contains(QSize(32, 32))); - QVERIFY(icon.availableSizes().contains(QSize(64, 64))); -} - -void tst_QWebEngineFaviconManager::candidateIcon() -{ - if (!QDir(TESTS_SOURCE_DIR).exists()) - W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-shortcut.html")); - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(m_page->iconUrl(), iconUrl); - QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt144.png"))); - - const QIcon &icon = m_page->icon(); - QVERIFY(!icon.isNull()); - QCOMPARE(icon.availableSizes().count(), 2); - QVERIFY(icon.availableSizes().contains(QSize(32, 32))); - QVERIFY(icon.availableSizes().contains(QSize(144, 144))); -} - -void tst_QWebEngineFaviconManager::downloadIconsDisabled_data() -{ - QTest::addColumn("url"); - QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html"); - QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html"); - QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html"); - QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html"); - QTest::newRow("unavailable") << QUrl("qrc:/resources/favicon-unavailable.html"); -} - -void tst_QWebEngineFaviconManager::downloadIconsDisabled() -{ - QFETCH(QUrl, url); - - m_page->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QCOMPARE(iconUrlChangedSpy.count(), 0); - QCOMPARE(iconChangedSpy.count(), 0); - - QVERIFY(m_page->iconUrl().isEmpty()); - QVERIFY(m_page->icon().isNull()); -} - -void tst_QWebEngineFaviconManager::downloadTouchIconsEnabled_data() -{ - QTest::addColumn("url"); - QTest::addColumn("expectedIconUrl"); - QTest::addColumn("expectedIconSize"); - QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144); - QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144); - QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html") << QUrl("qrc:/resources/icons/qt32.ico") << QSize(32, 32); - QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144); -} - -void tst_QWebEngineFaviconManager::downloadTouchIconsEnabled() -{ - QFETCH(QUrl, url); - QFETCH(QUrl, expectedIconUrl); - QFETCH(QSize, expectedIconSize); - - m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true); - - QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool))); - QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl))); - QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon))); - - m_page->load(url); - - QTRY_COMPARE(loadFinishedSpy.count(), 1); - QTRY_COMPARE(iconUrlChangedSpy.count(), 1); - QTRY_COMPARE(iconChangedSpy.count(), 1); - - const QUrl &iconUrl = iconUrlChangedSpy.at(0).at(0).toString(); - QCOMPARE(m_page->iconUrl(), iconUrl); - QCOMPARE(iconUrl, expectedIconUrl); - - const QIcon &icon = m_page->icon(); - QVERIFY(!icon.isNull()); - - QVERIFY(icon.availableSizes().count() >= 1); - QVERIFY(icon.availableSizes().contains(expectedIconSize)); -} - -QTEST_MAIN(tst_QWebEngineFaviconManager) - -#include "tst_qwebenginefaviconmanager.moc" diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc deleted file mode 100644 index a352f8a83..000000000 --- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc +++ /dev/null @@ -1,14 +0,0 @@ - - - resources/favicon-misc.html - resources/favicon-multi.html - resources/favicon-shortcut.html - resources/favicon-single.html - resources/favicon-touch.html - resources/favicon-unavailable.html - resources/icons/qt144.png - resources/icons/qt32.ico - resources/icons/qtmulti.ico - resources/test1.html - - diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 1629ec617..fcd40d4cc 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -241,8 +241,6 @@ private Q_SLOTS: void setZoomFactor(); void mouseButtonTranslation(); - void printToPdf(); - private: static QPoint elementCenter(QWebEnginePage *page, const QString &id); @@ -4221,6 +4219,9 @@ void tst_QWebEnginePage::baseUrl() void tst_QWebEnginePage::scrollPosition() { +#if !defined(QWEBENGINEPAGE_EVALUATEJAVASCRIPT) + QSKIP("QWEBENGINEPAGE_EVALUATEJAVASCRIPT"); +#else // enlarged image in a small viewport, to provoke the scrollbars to appear QString html(""); @@ -4243,6 +4244,7 @@ void tst_QWebEnginePage::scrollPosition() int y = evaluateJavaScriptSync(view.page(), "window.scrollY").toInt(); QCOMPARE(x, 23); QCOMPARE(y, 29); +#endif } void tst_QWebEnginePage::scrollToAnchor() @@ -4926,37 +4928,6 @@ void tst_QWebEnginePage::setZoomFactor() delete page; } -void tst_QWebEnginePage::printToPdf() -{ - QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX"); - QVERIFY(tempDir.isValid()); - QWebEnginePage page; - QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); - page.load(QUrl("qrc:///resources/basic_printing_page.html")); - QTRY_VERIFY(spy.count() == 1); - - QPageLayout layout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0)); - QString path = tempDir.path() + "/print_1_success.pdf"; - page.printToPdf(path, layout); - QTRY_VERIFY(QFile::exists(path)); - -#if !defined(Q_OS_WIN) - path = tempDir.path() + "/print_//2_failed.pdf"; -#else - path = tempDir.path() + "/print_|2_failed.pdf"; -#endif - page.printToPdf(path, QPageLayout()); - QTRY_VERIFY(!QFile::exists(path)); - - CallbackSpy successfulSpy; - page.printToPdf(successfulSpy.ref(), layout); - QVERIFY(successfulSpy.waitForResult().length() > 0); - - CallbackSpy failedInvalidLayoutSpy; - page.printToPdf(failedInvalidLayoutSpy.ref(), QPageLayout()); - QCOMPARE(failedInvalidLayoutSpy.waitForResult().length(), 0); -} - void tst_QWebEnginePage::mouseButtonTranslation() { QWebEngineView *view = new QWebEngineView; diff --git a/tests/auto/widgets/qwebengineprofile/BLACKLIST b/tests/auto/widgets/qwebengineprofile/BLACKLIST deleted file mode 100644 index fc1c957dd..000000000 --- a/tests/auto/widgets/qwebengineprofile/BLACKLIST +++ /dev/null @@ -1,5 +0,0 @@ -[clearDataFromCache] -* -[disableCache] -* - diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 579a0f776..8c7a0d399 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -44,8 +44,6 @@ class tst_QWebEngineProfile : public QObject private Q_SLOTS: void defaultProfile(); void profileConstructors(); - void clearDataFromCache(); - void disableCache(); void urlSchemeHandlers(); void urlSchemeHandlerFailRequest(); void urlSchemeHandlerFailOnRead(); @@ -78,77 +76,6 @@ void tst_QWebEngineProfile::profileConstructors() QCOMPARE(diskProfile.persistentCookiesPolicy(), QWebEngineProfile::AllowPersistentCookies); } -void tst_QWebEngineProfile::clearDataFromCache() -{ - QWebEnginePage page; - - QDir cacheDir("./tst_QWebEngineProfile_cacheDir"); - cacheDir.makeAbsolute(); - if (cacheDir.exists()) - cacheDir.removeRecursively(); - cacheDir.mkpath(cacheDir.path()); - - QWebEngineProfile *profile = page.profile(); - profile->setCachePath(cacheDir.path()); - profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache); - - QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool))); - page.load(QUrl("http://qt-project.org")); - if (!loadFinishedSpy.wait(10000) || !loadFinishedSpy.at(0).at(0).toBool()) - QSKIP("Couldn't load page from network, skipping test."); - - cacheDir.refresh(); - QVERIFY(cacheDir.entryList().contains("Cache")); - cacheDir.cd("./Cache"); - int filesBeforeClear = cacheDir.entryList().count(); - - QFileSystemWatcher fileSystemWatcher; - fileSystemWatcher.addPath(cacheDir.path()); - QSignalSpy directoryChangedSpy(&fileSystemWatcher, SIGNAL(directoryChanged(const QString &))); - - // It deletes most of the files, but not all of them. - profile->clearHttpCache(); - QTest::qWait(1000); - QTRY_VERIFY(directoryChangedSpy.count() > 0); - - cacheDir.refresh(); - QVERIFY(filesBeforeClear > cacheDir.entryList().count()); - - cacheDir.removeRecursively(); -} - -void tst_QWebEngineProfile::disableCache() -{ - QWebEnginePage page; - QDir cacheDir("./tst_QWebEngineProfile_cacheDir"); - if (cacheDir.exists()) - cacheDir.removeRecursively(); - cacheDir.mkpath(cacheDir.path()); - - QWebEngineProfile *profile = page.profile(); - profile->setCachePath(cacheDir.path()); - QVERIFY(!cacheDir.entryList().contains("Cache")); - - profile->setHttpCacheType(QWebEngineProfile::NoCache); - QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool))); - page.load(QUrl("http://qt-project.org")); - if (!loadFinishedSpy.wait(10000) || !loadFinishedSpy.at(0).at(0).toBool()) - QSKIP("Couldn't load page from network, skipping test."); - - cacheDir.refresh(); - QVERIFY(!cacheDir.entryList().contains("Cache")); - - profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache); - page.load(QUrl("http://qt-project.org")); - if (!loadFinishedSpy.wait(10000) || !loadFinishedSpy.at(1).at(0).toBool()) - QSKIP("Couldn't load page from network, skipping test."); - - cacheDir.refresh(); - QVERIFY(cacheDir.entryList().contains("Cache")); - - cacheDir.removeRecursively(); -} - class RedirectingUrlSchemeHandler : public QWebEngineUrlSchemeHandler { public: diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp index d5ecd8841..2c0b848c9 100644 --- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp +++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp @@ -118,14 +118,12 @@ void tst_QWebEngineScript::scriptWorld() page.load(QUrl("about:blank")); waitForSignal(&page, SIGNAL(loadFinished(bool))); QCOMPARE(evaluateJavaScriptSync(&page, "typeof(userScriptTest) != \"undefined\" && userScriptTest == 1;"), QVariant::fromValue(true)); - QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "typeof(userScriptTest) == \"undefined\"", QWebEngineScript::ApplicationWorld), QVariant::fromValue(true)); script.setWorldId(QWebEngineScript::ApplicationWorld); page.scripts().clear(); page.scripts().insert(script); page.load(QUrl("about:blank")); waitForSignal(&page, SIGNAL(loadFinished(bool))); QCOMPARE(evaluateJavaScriptSync(&page, "typeof(userScriptTest) == \"undefined\""), QVariant::fromValue(true)); - QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "typeof(userScriptTest) != \"undefined\" && userScriptTest == 1;", QWebEngineScript::ApplicationWorld), QVariant::fromValue(true)); } void tst_QWebEngineScript::scriptModifications() @@ -183,9 +181,7 @@ void tst_QWebEngineScript::webChannel_data() QTest::addColumn("worldId"); QTest::addColumn("reloadFirst"); QTest::newRow("MainWorld") << static_cast(QWebEngineScript::MainWorld) << false; - QTest::newRow("ApplicationWorld") << static_cast(QWebEngineScript::ApplicationWorld) << false; QTest::newRow("MainWorldWithReload") << static_cast(QWebEngineScript::MainWorld) << true; - QTest::newRow("ApplicationWorldWithReload") << static_cast(QWebEngineScript::ApplicationWorld) << true; } void tst_QWebEngineScript::webChannel() @@ -196,7 +192,7 @@ void tst_QWebEngineScript::webChannel() TestObject testObject; QScopedPointer channel(new QWebChannel(this)); channel->registerObject(QStringLiteral("object"), &testObject); - page.setWebChannel(channel.data(), worldId); + page.setWebChannel(channel.data()); QFile qwebchanneljs(":/qwebchannel.js"); QVERIFY(qwebchanneljs.exists()); @@ -220,7 +216,7 @@ void tst_QWebEngineScript::webChannel() " function(channel) {" " channel.objects.object.text = 'test';" " }" - ");"), worldId); + ");")); waitForSignal(&testObject, SIGNAL(textChanged(QString))); QCOMPARE(testObject.text(), QStringLiteral("test")); diff --git a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff b/tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff deleted file mode 100644 index ff8185771..000000000 --- a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff +++ /dev/null @@ -1,5 +0,0 @@ -SET UTF-8 -TRY esianrtolcdugmphbyfvkwzqESIANRTOLCDUGMPHBYFVKWZQ - -PFX Q Y 1 -PFX Q 0 q . diff --git a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic b/tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic deleted file mode 100644 index 3d4ecdfa4..000000000 --- a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic +++ /dev/null @@ -1,11 +0,0 @@ -10 -he/Q -I/Q -it/Q -love/Q -loves/Q -qt/Q -she/Q -they/Q -we/Q -you/Q diff --git a/tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro b/tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro deleted file mode 100644 index 437aad937..000000000 --- a/tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro +++ /dev/null @@ -1,22 +0,0 @@ -include(../tests.pri) - -DISTFILES += \ - dict/en-US.dic \ - dict/en-US.aff - -qtPrepareTool(CONVERT_TOOL, qwebengine_convert_dict) - -debug_and_release { - CONFIG(debug, debug|release): DICTIONARIES_DIR = debug/qtwebengine_dictionaries - else: DICTIONARIES_DIR = release/qtwebengine_dictionaries -} else { - DICTIONARIES_DIR = qtwebengine_dictionaries -} - -dict.files = $$PWD/dict/en-US.dic -dictoolbuild.input = dict.files -dictoolbuild.output = $${DICTIONARIES_DIR}/${QMAKE_FILE_BASE}.bdic -dictoolbuild.commands = $${CONVERT_TOOL} ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} -dictoolbuild.name = Build ${QMAKE_FILE_IN_BASE} -dictoolbuild.CONFIG = no_link target_predeps -QMAKE_EXTRA_COMPILERS += dictoolbuild diff --git a/tests/auto/widgets/qwebenginespellcheck/resources/index.html b/tests/auto/widgets/qwebenginespellcheck/resources/index.html deleted file mode 100644 index 520979244..000000000 --- a/tests/auto/widgets/qwebenginespellcheck/resources/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - -
- - - diff --git a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp b/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp deleted file mode 100644 index 2dfe3305d..000000000 --- a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "util.h" -#include -#include -#include -#include -#include - -class WebView : public QWebEngineView -{ - Q_OBJECT -public: - void activateMenu(const QPoint &position) - { - QTest::mouseMove(focusWidget(), position); - QTest::mousePress(focusWidget(), Qt::RightButton, 0, position); - QContextMenuEvent evcont(QContextMenuEvent::Mouse, position, mapToGlobal(position)); - event(&evcont); - } - - const QWebEngineContextMenuData& data() - { - return m_data; - } - -signals: - void menuReady(); - -protected: - void contextMenuEvent(QContextMenuEvent *) - { - m_data = page()->contextMenuData(); - emit menuReady(); - } -private: - QWebEngineContextMenuData m_data; -}; - -class tst_QWebEngineSpellcheck : public QObject -{ - Q_OBJECT - -private Q_SLOTS: - void init(); - void cleanup(); - void initTestCase(); - void spellCheckLanguage(); - void spellCheckEnabled(); - void spellcheck(); - -private: - void load(); - WebView *m_view; -}; - -void tst_QWebEngineSpellcheck::initTestCase() -{ - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - QVERIFY(profile); - QVERIFY(!profile->isSpellCheckEnabled()); - QVERIFY(profile->spellCheckLanguage().isEmpty()); -} - -void tst_QWebEngineSpellcheck::init() -{ - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - profile->setSpellCheckEnabled(false); - profile->setSpellCheckLanguage(QString::null); - m_view = new WebView(); -} - -void tst_QWebEngineSpellcheck::load() -{ - m_view->page()->load(QUrl("qrc:///resources/index.html")); - m_view->show(); - waitForSignal(m_view->page(), SIGNAL(loadFinished(bool))); -} - -void tst_QWebEngineSpellcheck::cleanup() -{ - delete m_view; -} - -void tst_QWebEngineSpellcheck::spellCheckLanguage() -{ - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - QVERIFY(profile); - profile->setSpellCheckLanguage("en-US"); - QVERIFY(profile->spellCheckLanguage() == "en-US"); -} - -void tst_QWebEngineSpellcheck::spellCheckEnabled() -{ - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - QVERIFY(profile); - profile->setSpellCheckEnabled(true); - QVERIFY(profile->isSpellCheckEnabled()); -} - -void tst_QWebEngineSpellcheck::spellcheck() -{ - QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); - QVERIFY(profile); - profile->setSpellCheckLanguage("en-US"); - profile->setSpellCheckEnabled(true); - load(); - - // make textarea editable - evaluateJavaScriptSync(m_view->page(), "makeEditable();"); - - // calcuate position of misspelled word - QVariantList list = evaluateJavaScriptSync(m_view->page(), "findWordPosition('I lovee Qt ....','lovee');").toList(); - QRect rect(list[0].value(),list[1].value(),list[2].value(),list[3].value()); - - //type text, spellchecker needs time - QTest::mouseMove(m_view->focusWidget(), QPoint(20,20)); - QTest::mousePress(m_view->focusWidget(), Qt::LeftButton, 0, QPoint(20,20)); - QString text("I lovee Qt ...."); - for (int i = 0; i < text.length(); i++) { - QTest::keyClicks(m_view->focusWidget(), text.at(i)); - QTest::qWait(60); - } - - // make sure text is there - QString result = evaluateJavaScriptSync(m_view->page(), "text();").toString(); - QVERIFY(result == text); - - // open menu on misspelled word - m_view->activateMenu(rect.center()); - waitForSignal(m_view, SIGNAL(menuReady())); - - // check if menu is valid - QVERIFY(m_view->data().isValid()); - QVERIFY(m_view->data().isContentEditable()); - - // check misspelled word - QVERIFY(m_view->data().misspelledWord() == "lovee"); - - // check suggestions - QStringList expected {"love", "loves"}; - QVERIFY(m_view->data().spellCheckerSuggestions() == expected); - - // check replace word - m_view->page()->replaceMisspelledWord("love"); - text = "I love Qt ...."; - result = evaluateJavaScriptSync(m_view->page(), "text();").toString(); - QVERIFY(result == text); -} - -QTEST_MAIN(tst_QWebEngineSpellcheck) -#include "tst_qwebenginespellcheck.moc" diff --git a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc b/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc deleted file mode 100644 index 505b932c7..000000000 --- a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - resources/index.html - - diff --git a/tests/auto/widgets/qwebengineview/resources/basic_printing_page.html b/tests/auto/widgets/qwebengineview/resources/basic_printing_page.html deleted file mode 100644 index 0c6ff379f..000000000 --- a/tests/auto/widgets/qwebengineview/resources/basic_printing_page.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Basic Printing Page - - -

Hello Paper World

- - diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc index b32b533c2..0b8676a09 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc @@ -4,6 +4,5 @@ resources/frame_a.html resources/input_types.html resources/scrolltest_page.html - resources/basic_printing_page.html diff --git a/tests/auto/widgets/util.h b/tests/auto/widgets/util.h index 770579f1f..f9bdbec4d 100644 --- a/tests/auto/widgets/util.h +++ b/tests/auto/widgets/util.h @@ -166,13 +166,6 @@ static inline QVariant evaluateJavaScriptSync(QWebEnginePage *page, const QStrin return spy.waitForResult(); } -static inline QVariant evaluateJavaScriptSyncInWorld(QWebEnginePage *page, const QString &script, int worldId) -{ - CallbackSpy spy; - page->runJavaScript(script, worldId, spy.ref()); - return spy.waitForResult(); -} - static inline QUrl baseUrlSync(QWebEnginePage *page) { CallbackSpy spy; diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index 2f5416701..fef9ea83a 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -3,7 +3,6 @@ TEMPLATE = subdirs SUBDIRS += \ qwebengineaccessibility \ qwebenginedefaultsurfaceformat \ - qwebenginefaviconmanager \ qwebenginepage \ qwebenginehistory \ qwebenginehistoryinterface \ @@ -12,8 +11,3 @@ SUBDIRS += \ qwebenginescript \ qwebenginesettings \ qwebengineview - -# QTBUG-53135, osx does not use hunspell -!contains(WEBENGINE_CONFIG, no_spellcheck):!osx:!cross_compile { - SUBDIRS += qwebenginespellcheck -} -- cgit v1.2.3