Android tests: Fix for moving file in content URI test
In Android's manual URI content test, there is a test case for moving a file to another directory. While the function works and the file is moved correctly, the URI is no longer usable after this operation. The file must be reopened with a new URI. This commit updates fileOperations test case to use the new URL after moving file to another directory Pick-to: 6.8 Fixes: QTBUG-134881 Change-Id: I114d76d6851815e7ee3d94ddc28d677d7c1ccea9 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 1a35a560ddcaf03d9e2f5f91cd6bcd006c6d0951) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f4c1d51cae
commit
95ea70197f
@ -239,12 +239,16 @@ void tst_ContentUris::fileOperations()
|
||||
|
||||
QVERIFY(file.rename(destDir + u'/' + fileName));
|
||||
|
||||
// NOTE: The uri doesn't seem to stay usable after a rename and it needs to get
|
||||
// permission again via the SAF picker.
|
||||
// NOTE: The uri doesn't seem to stay usable after a rename, but the file should
|
||||
// be already moved to the new path. To check and remove file need to use new url
|
||||
file.close();
|
||||
showInstructionsDialog("Choose the file that was moved");
|
||||
QFileDialog::getOpenFileName(nullptr, tr("Open File"));
|
||||
const auto url = QFileDialog::getOpenFileName(nullptr, tr("Open File"));
|
||||
|
||||
file.setFileName(url);
|
||||
QVERIFY(file.exists());
|
||||
QVERIFY(file.remove());
|
||||
QVERIFY(!file.exists());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user