summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2023-02-24 14:57:52 +0100
committerMichal Klocek <michal.klocek@qt.io>2023-03-02 12:10:13 +0100
commit47c398a510d13b1bbe41a665141f9eea52ffac32 (patch)
tree4e11f2f154646cf6c07ccd864c771dce9c1ed5e6 /tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
parentd7a03bf28152fe4d7666c97c548d2d7d2c809184 (diff)
Fix initialization of QWebEngineDownloadRequest::totalBytes for Widgets
QQuickWebEngineProfile already initializes totalBytes. Also clean up QWebEngineDownloadRequestPrivate and fix typo in documentation. Fixes: QTBUG-104869 Change-Id: I8c4b79c076ddc63180960e22a9488b45ff6c4402 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 496647f7647571ca3cdf81b10ba418de0f06f34d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 01be7f108c0d501f532b197f091baaaaba211ee6)
Diffstat (limited to 'tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp')
-rw-r--r--tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
index 1c2268b31..c81a27b3a 100644
--- a/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
+++ b/tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp
@@ -415,7 +415,7 @@ void tst_QWebEngineDownloadRequest::downloadLink()
ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
QCOMPARE(item->isFinished(), false);
- QCOMPARE(item->totalBytes(), -1);
+ QCOMPARE(item->totalBytes(), fileContents.size());
QCOMPARE(item->receivedBytes(), 0);
QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
QCOMPARE(item->isSavePageDownload(), false);
@@ -526,7 +526,7 @@ void tst_QWebEngineDownloadRequest::downloadTwoLinks()
ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadRequest *item) {
QCOMPARE(item->state(), QWebEngineDownloadRequest::DownloadRequested);
QCOMPARE(item->isFinished(), false);
- QCOMPARE(item->totalBytes(), -1);
+ QCOMPARE(item->totalBytes(), 5); // strlen("fileN")
QCOMPARE(item->receivedBytes(), 0);
QCOMPARE(item->interruptReason(), QWebEngineDownloadRequest::NoReason);
QCOMPARE(item->savePageFormat(), QWebEngineDownloadRequest::UnknownSaveFormat);