diff options
author | Balazs Egedi <egedib@inf.u-szeged.hu> | 2021-05-05 14:23:38 +0200 |
---|---|---|
committer | Balazs Egedi <egedib@inf.u-szeged.hu> | 2021-05-07 01:31:58 +0200 |
commit | 2250a262fa3ecc68706e5e5905d44c3c04a482a9 (patch) | |
tree | 19e5561d70b0c9d226ebebd8de84c1b7325296e1 /tests/auto/quick | |
parent | a5c7b4d4f16574e35ce36550bda2d45baf345c79 (diff) |
Fix QWebEngineDownloadRequest signals
downloadFileNameChanged and downloadDirectoryChanged signals were removed in
08375ee7 Rename QWebEngineDownloadItem -> QWebEngineDownloadRequest.
Reintroduce these signals because they are still part of the API.
Also test these in Widgets auto test.
QQuickWebEngineDownloadItem::pathChanged were also removed in
75393077 Remove obsolete, deprecated api from qwebenginedownloaditem.
Remove the pathChanged signal checks from the test because it was deprecated.
The test tst_download.qml does not have quickcontrols1 dependency.
Update it in the project file and re-enable the test.
Change-Id: I702e04dfe2179beafc558a628bfa07f4090fede2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_download.qml | 33 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/qmltests.pro | 2 |
2 files changed, 1 insertions, 34 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_download.qml b/tests/auto/quick/qmltests/data/tst_download.qml index 894bb018a..a26060046 100644 --- a/tests/auto/quick/qmltests/data/tst_download.qml +++ b/tests/auto/quick/qmltests/data/tst_download.qml @@ -51,7 +51,6 @@ TestWebEngineView { property string downloadedSetPath: "" property int downloadDirectoryChanged: 0 property int downloadFileNameChanged: 0 - property int downloadPathChanged: 0 property bool setDirectoryFirst: false TempDir { id: tempDir } @@ -92,9 +91,6 @@ TestWebEngineView { function onDownloadFileNameChanged() { downloadFileNameChanged++; } - function onPathChanged() { - downloadPathChanged++; - } } WebEngineProfile { @@ -149,7 +145,6 @@ TestWebEngineView { downloadInterruptReason = null downloadDirectoryChanged = 0 downloadFileNameChanged = 0 - downloadPathChanged = 0 downloadDirectory = "" downloadFileName = "" downloadedPath = "" @@ -245,7 +240,6 @@ TestWebEngineView { compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + downloadFileName); compare(downloadDirectoryChanged, 1); compare(downloadFileNameChanged, 1); - compare(downloadPathChanged, 2); downloadFinishedSpy.wait(); compare(totalBytes, receivedBytes); tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted); @@ -268,7 +262,6 @@ TestWebEngineView { compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + "download.zip"); compare(downloadDirectoryChanged, 1); compare(downloadFileNameChanged, 0); - compare(downloadPathChanged, 1); downloadFinishedSpy.wait(); compare(totalBytes, receivedBytes); tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted); @@ -280,7 +273,6 @@ TestWebEngineView { compare(downLoadRequestedSpy.count, 0); downloadDirectoryChanged = 0; downloadFileNameChanged = 0; - downloadPathChanged = 0; downloadDirectory = "/test_downloadToDirectoryWithSuggestedFileName1/"; webEngineView.url = Qt.resolvedUrl("download.zip"); downLoadRequestedSpy.wait(); @@ -292,7 +284,6 @@ TestWebEngineView { compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + "download.zip"); compare(downloadDirectoryChanged, 1); compare(downloadFileNameChanged, 0); - compare(downloadPathChanged, 1); downloadFinishedSpy.wait(); compare(totalBytes, receivedBytes); tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted); @@ -304,7 +295,6 @@ TestWebEngineView { compare(downLoadRequestedSpy.count, 0); downloadDirectoryChanged = 0; downloadFileNameChanged = 0; - downloadPathChanged = 0; downloadDirectory = "/test_downloadToDirectoryWithSuggestedFileName1/"; webEngineView.url = Qt.resolvedUrl("download.zip"); downLoadRequestedSpy.wait(); @@ -316,29 +306,6 @@ TestWebEngineView { compare(downloadedPath, testDownloadProfile.downloadPath + downloadDirectory + "download (1).zip"); compare(downloadDirectoryChanged, 1); compare(downloadFileNameChanged, 1); - compare(downloadPathChanged, 1); - downloadFinishedSpy.wait(); - compare(totalBytes, receivedBytes); - tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted); - verify(!downloadInterruptReason); -} - - function test_downloadWithSetPath() { - compare(downLoadRequestedSpy.count, 0); - compare(downloadDirectoryChanged, 0); - compare(downloadFileNameChanged, 0); - downloadedSetPath = "/test_downloadWithSetPath/test.zip"; - webEngineView.url = Qt.resolvedUrl("download.zip"); - downLoadRequestedSpy.wait(); - compare(downLoadRequestedSpy.count, 1); - compare(downloadUrl, webEngineView.url); - compare(suggestedFileName, "download.zip"); - compare(downloadState[0], WebEngineDownloadRequest.DownloadRequested); - tryCompare(downloadState, "1", WebEngineDownloadRequest.DownloadInProgress); - compare(downloadedPath, testDownloadProfile.downloadPath + downloadedSetPath); - compare(downloadDirectoryChanged, 1); - compare(downloadFileNameChanged, 1); - compare(downloadPathChanged, 2); downloadFinishedSpy.wait(); compare(totalBytes, receivedBytes); tryCompare(downloadState, "2", WebEngineDownloadRequest.DownloadCompleted); diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 984d41064..e5e84d3c7 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -12,6 +12,7 @@ QML_TESTS = \ $$PWD/data/tst_activeFocusOnPress.qml \ $$PWD/data/tst_audioMuted.qml \ $$PWD/data/tst_desktopBehaviorLoadHtml.qml \ + $$PWD/data/tst_download.qml \ $$PWD/data/tst_findText.qml \ $$PWD/data/tst_focusOnNavigation.qml \ $$PWD/data/tst_fullScreenRequest.qml \ @@ -81,7 +82,6 @@ qtConfig(webenginequick-testsupport) { qtHaveModule(quickcontrols) { QML_TESTS += \ $$PWD/data/tst_contextMenu.qml \ - $$PWD/data/tst_download.qml \ $$PWD/data/tst_filePicker.qml } |