From 3752a3cbcd0cc0742a5b955e925df18395afdb75 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 18 Jun 2021 11:39:36 +0200 Subject: 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 (cherry picked from commit b2ecb708e149fe8914d7d0cbfcf9c300e52a029e) Reviewed-by: Qt Cherry-pick Bot --- .../tst_qwebenginedownloadrequest.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/auto/widgets') 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(); -- cgit v1.2.3