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

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

Issue 2591523002: Fuchsia: Adds File::Copy() (Closed)
Patch Set: Address comments Created 4 years 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/file_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 fd8363a90a101dad3ac9e341d88eea44605b8316..8053b8505a6e88809e6e577dd95a700a03376445 100644
--- a/runtime/tests/vm/dart/hello_fuchsia_test.dart
+++ b/runtime/tests/vm/dart/hello_fuchsia_test.dart
@@ -412,6 +412,25 @@ void testPlatformEnvironment() {
}
}
+Future testCopy() async {
+ final String sourceName = "foo";
+ final String destName = "bar";
+ Directory tmp = await Directory.systemTemp.createTemp("testCopy");
+ File sourceFile = new File("${tmp.path}/$sourceName");
+ File destFile = new File("${tmp.path}/$destName");
+ List<int> data = new List<int>.generate(10 * 1024, (int i) => i & 0xff);
+ await sourceFile.writeAsBytes(data);
+ await sourceFile.copy(destFile.path);
+ List<int> resultData = await destFile.readAsBytes();
+ assert(data.length == resultData.length);
+ for (int i = 0; i < data.length; i++) {
+ assert(data[i] == resultData[i]);
+ }
+ await sourceFile.delete();
+ await destFile.delete();
+ await tmp.delete();
+}
+
main() async {
print("Hello, Fuchsia!");
@@ -459,5 +478,9 @@ main() async {
testProcessRunSync();
print("testProcessRunSync done");
+ print("testCopy");
+ await testCopy();
+ print("testCopy done");
+
print("Goodbyte, Fuchsia!");
}
« no previous file with comments | « runtime/bin/file_fuchsia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698