diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-02-24 14:57:52 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-03-06 01:57:15 +0100 |
commit | a7454f915d3db7d6711f6ad5e9991606aec3c4a5 (patch) | |
tree | f1cb88a6668bca7c064f0e9d1ac7763c29fcd180 /tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp | |
parent | 79c08a1ad875f1a367ff1765c84ab02d7a94ade4 (diff) |
Fix initialization of QWebEngineDownloadItem::totalBytes for Widgets
QQuickWebEngineProfile already initializes totalBytes.
Also 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: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp')
-rw-r--r-- | tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp index 9a3e7b52e..74082ab8c 100644 --- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp +++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp @@ -455,7 +455,7 @@ void tst_QWebEngineDownloadItem::downloadLink() ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) { QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested); QCOMPARE(item->isFinished(), false); - QCOMPARE(item->totalBytes(), -1); + QCOMPARE(item->totalBytes(), fileContents.size()); QCOMPARE(item->receivedBytes(), 0); QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason); QCOMPARE(item->type(), expectedDownloadType(userAction, fileDisposition)); @@ -568,7 +568,7 @@ void tst_QWebEngineDownloadItem::downloadTwoLinks() ScopedConnection sc2 = connect(m_profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) { QCOMPARE(item->state(), QWebEngineDownloadItem::DownloadRequested); QCOMPARE(item->isFinished(), false); - QCOMPARE(item->totalBytes(), -1); + QCOMPARE(item->totalBytes(), 5); // strlen("fileN") QCOMPARE(item->receivedBytes(), 0); QCOMPARE(item->interruptReason(), QWebEngineDownloadItem::NoReason); QCOMPARE(item->savePageFormat(), QWebEngineDownloadItem::UnknownSaveFormat); |