diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/android_content_uri/tst_content_uris.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/manual/android_content_uri/tst_content_uris.cpp b/tests/manual/android_content_uri/tst_content_uris.cpp index 6795415229..4f8b9a9971 100644 --- a/tests/manual/android_content_uri/tst_content_uris.cpp +++ b/tests/manual/android_content_uri/tst_content_uris.cpp @@ -195,6 +195,30 @@ void tst_ContentUris::fileOperations() QFile file(url); QVERIFY(file.exists()); + // Rename + const QString renamedFileName = "renamed_new_file.txt"; + QVERIFY(file.rename(renamedFileName)); + const auto renamedUrl = url.replace(fileName, renamedFileName); + QVERIFY(file.fileName() == renamedUrl); + + // NOTE: The uri doesn't seem to stay usable after a rename and it needs to get + // permission again via the SAF picker. + showInstructionsDialog("Choose the file that was renamed"); + QFileDialog::getOpenFileName(nullptr, tr("Open File")); + QVERIFY(file.exists()); + + // rename now with full content uri + const auto secondRenamedUrl = url.replace(renamedFileName, "second_nenamed_file.txt"); + QVERIFY(file.rename(secondRenamedUrl)); + QVERIFY(file.fileName() == secondRenamedUrl); + + // NOTE: The uri doesn't seem to stay usable after a rename and it needs to get + // permission again via the SAF picker. + showInstructionsDialog("Choose the file that was renamed"); + QFileDialog::getOpenFileName(nullptr, tr("Open File")); + QVERIFY(file.exists()); + + // Remove QVERIFY(file.remove()); QVERIFY(!file.exists()); } |