diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-18 11:39:36 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-22 03:32:24 +0000 |
commit | 3752a3cbcd0cc0742a5b955e925df18395afdb75 (patch) | |
tree | 453369210f11bd672441d11ef4065e79109ac260 /tests | |
parent | 15e5ba4bfc920adf56df8dd11cb09ca3a9942963 (diff) |
Add page() and view() back to download-item
Restores a QML type but this time derived from the core type.
Change-Id: I09ddb6672f7262ae31e4c57f09d019f71abccd41
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
(cherry picked from commit b2ecb708e149fe8914d7d0cbfcf9c300e52a029e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/publicapi/tst_publicapi.cpp | 8 | ||||
-rw-r--r-- | tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp | 14 |
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index c4188cd37..46cc25514 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -51,6 +51,7 @@ #include <private/qquickwebengineaction_p.h> #include <private/qquickwebengineclientcertificateselection_p.h> #include <private/qquickwebenginedialogrequests_p.h> +#include <private/qquickwebenginedownloadrequest_p.h> #include <private/qquickwebenginesettings_p.h> #include <private/qquickwebenginesingleton_p.h> @@ -65,6 +66,7 @@ static const QList<const QMetaObject *> typesToCheck = QList<const QMetaObject * << &QQuickWebEngineAction::staticMetaObject << &QQuickWebEngineClientCertificateOption::staticMetaObject << &QQuickWebEngineClientCertificateSelection::staticMetaObject + << &QQuickWebEngineDownloadRequest::staticMetaObject << &QWebEngineDownloadRequest::staticMetaObject << &QWebEngineHistory::staticMetaObject << &QWebEngineHistoryModel::staticMetaObject @@ -254,7 +256,6 @@ static const QStringList expectedAPI = QStringList() << "QWebEngineDownloadRequest.stateChanged(QWebEngineDownloadRequest::DownloadState) --> void" << "QWebEngineDownloadRequest.totalBytes --> qlonglong" << "QWebEngineDownloadRequest.totalBytesChanged() --> void" - // FIXME << "QWebEngineDownloadRequest.view --> QQuickWebEngineView*" << "QWebEngineDownloadRequest.url --> QUrl" << "QWebEngineDownloadRequest.suggestedFileName --> QString" << "QWebEngineDownloadRequest.downloadDirectory --> QString" @@ -262,6 +263,7 @@ static const QStringList expectedAPI = QStringList() << "QWebEngineDownloadRequest.downloadFileName --> QString" << "QWebEngineDownloadRequest.downloadFileNameChanged() --> void" << "QWebEngineDownloadRequest.downloadProgress(qlonglong,qlonglong) --> void" // FIXME + << "QQuickWebEngineDownloadRequest.view --> QQuickWebEngineView*" << "QQuickWebEngineFileDialogRequest.FileModeOpen --> FileMode" << "QQuickWebEngineFileDialogRequest.FileModeOpenMultiple --> FileMode" << "QQuickWebEngineFileDialogRequest.FileModeSave --> FileMode" @@ -358,8 +360,8 @@ static const QStringList expectedAPI = QStringList() << "QQuickWebEngineProfile.cachePath --> QString" << "QQuickWebEngineProfile.cachePathChanged() --> void" << "QQuickWebEngineProfile.clearHttpCache() --> void" - << "QQuickWebEngineProfile.downloadFinished(QWebEngineDownloadRequest*) --> void" - << "QQuickWebEngineProfile.downloadRequested(QWebEngineDownloadRequest*) --> void" + << "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadRequest*) --> void" + << "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadRequest*) --> void" << "QQuickWebEngineProfile.downloadPath --> QString" << "QQuickWebEngineProfile.downloadPathChanged() --> void" << "QQuickWebEngineProfile.presentNotification(QWebEngineNotification*) --> void" diff --git a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp index f95c4ab33..1f24928ab 100644 --- a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp +++ b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp @@ -445,7 +445,7 @@ void tst_QWebEngineDownloadRequest::downloadLink() QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), suggestedPath); QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat); QCOMPARE(item->url(), downloadUrl); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); connect(item, &QWebEngineDownloadRequest::isFinishedChanged, [&, item]() { QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadCompleted); @@ -458,7 +458,7 @@ void tst_QWebEngineDownloadRequest::downloadLink() QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath); QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat); QCOMPARE(item->url(), downloadUrl); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); finishedCount++; }); @@ -631,7 +631,7 @@ void tst_QWebEngineDownloadRequest::downloadPage() QCOMPARE(item->mimeType(), QStringLiteral("application/x-mimearchive")); QCOMPARE(item->savePageFormat(), savePageFormat); QCOMPARE(item->url(), downloadUrl); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); if (saveWithPageAction) { QVERIFY(!item->downloadDirectory().isEmpty()); @@ -654,7 +654,7 @@ void tst_QWebEngineDownloadRequest::downloadPage() QCOMPARE(QDir(item->downloadDirectory()).filePath(item->downloadFileName()), downloadPath); QCOMPARE(item->savePageFormat(), savePageFormat); QCOMPARE(item->url(), downloadUrl); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); finishedCount++; }); @@ -934,7 +934,7 @@ void tst_QWebEngineDownloadRequest::downloadUniqueFilenameWithTimestamp() QCOMPARE(item->totalBytes(), item->receivedBytes()); QVERIFY(item->receivedBytes() > 0); QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); downloadFinished = true; downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName()); }); @@ -1030,7 +1030,7 @@ void tst_QWebEngineDownloadRequest::downloadToNonExistentDir() QCOMPARE(item->totalBytes(), item->receivedBytes()); QVERIFY(item->receivedBytes() > 0); QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); downloadFinished = true; downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName()); }); @@ -1179,7 +1179,7 @@ void tst_QWebEngineDownloadRequest::downloadToDirectoryWithFileName() QCOMPARE(item->totalBytes(), item->receivedBytes()); QVERIFY(item->receivedBytes() > 0); QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason); - QCOMPARE(QWebEnginePage::fromDownloadRequest(item), m_page); + QCOMPARE(item->page(), m_page); downloadFinished = true; downloadedFilePath = QDir(item->downloadDirectory()).filePath(item->downloadFileName()); downloadedSuggestedFileName = item->suggestedFileName(); |