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

Side by Side Diff: tests/corelib_strong/file_resource_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:io"; 5 import "dart:io";
6 6
7 const sampleText = "Sample text file."; 7 const sampleText = "Sample text file.";
8 8
9 main() async { 9 main() async {
10 var file = await createFile(); 10 var file = await createFile();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 var tempDir = await Directory.systemTemp.createTemp("sample"); 50 var tempDir = await Directory.systemTemp.createTemp("sample");
51 var filePath = tempDir.path + Platform.pathSeparator + "sample.txt"; 51 var filePath = tempDir.path + Platform.pathSeparator + "sample.txt";
52 var file = new File(filePath); 52 var file = new File(filePath);
53 await file.create(); 53 await file.create();
54 await file.writeAsString(sampleText); 54 await file.writeAsString(sampleText);
55 return file; 55 return file;
56 } 56 }
57 57
58 deleteFile(File file) async { 58 deleteFile(File file) async {
59 // Removes the file and the temporary directory it's in. 59 // Removes the file and the temporary directory it's in.
60 var parentDir = new Directory(file.path.substring(0, 60 var parentDir = new Directory(
61 file.path.lastIndexOf(Platform.pathSeparator))); 61 file.path.substring(0, file.path.lastIndexOf(Platform.pathSeparator)));
62 await parentDir.delete(recursive: true); 62 await parentDir.delete(recursive: true);
63 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698