Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: runtime/tests/vm/dart/hello_fuchsia_test.dart

Issue 2621093002: Fuchsia: Implement recursive delete (Closed)
Patch Set: Format Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/directory_fuchsia.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tests/vm/dart/hello_fuchsia_test.dart
diff --git a/runtime/tests/vm/dart/hello_fuchsia_test.dart b/runtime/tests/vm/dart/hello_fuchsia_test.dart
index eb2aaf49b255e9d2e19f1b0e6cc258d9894c0cdd..8d597f2778cc70b299f964604218b042ec55d3cb 100644
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart
@@ -442,6 +442,28 @@ Future testCopy() async {
await tmp.delete();
}
+Future testRecursiveDelete() async {
+ Directory tmp0 = await Directory.systemTemp.createTemp("testRD");
+ Directory tmp1 = await tmp0.createTemp("testRD");
+ Directory tmp2 = await tmp1.createTemp("testRD");
+ File file0 = new File("${tmp0.path}/file");
+ File file1 = new File("${tmp1.path}/file");
+ File file2 = new File("${tmp2.path}/file");
+ List<int> data = new List<int>.generate(10 * 1024, (int i) => i & 0xff);
+ await file0.writeAsBytes(data);
+ await file1.writeAsBytes(data);
+ await file2.writeAsBytes(data);
+
+ await tmp0.delete(recursive: true);
+
+ assert(!await file2.exists());
+ assert(!await file1.exists());
+ assert(!await file0.exists());
+ assert(!await tmp2.exists());
+ assert(!await tmp1.exists());
+ assert(!await tmp0.exists());
+}
+
main(List<String> args) async {
if (args.length >= 1) {
if (args[0] == "infinite-loop") {
@@ -503,5 +525,9 @@ main(List<String> args) async {
await testCopy();
print("testCopy done");
+ print("testRecursiveDelete");
+ await testRecursiveDelete();
+ print("testRecursiveDelete done");
+
print("Goodbyte, Fuchsia!");
}
« no previous file with comments | « runtime/bin/directory_fuchsia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698