OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * Read the contents of a file [fileName] into a [List] of [String]s. | 6 * Read the contents of a file [fileName] into a [List] of [String]s. |
7 * If the file does not exist and [errorIfNoFile] is true, throw an | 7 * If the file does not exist and [errorIfNoFile] is true, throw an |
8 * exception, else return an empty list. | 8 * exception, else return an empty list. |
9 */ | 9 */ |
10 List<String> getFileContents(String filename, bool errorIfNoFile) { | 10 List<String> getFileContents(String filename, bool errorIfNoFile) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (--dirCount == 0) { | 93 if (--dirCount == 0) { |
94 onComplete(files); | 94 onComplete(files); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 /** Delete a file. */ | 98 /** Delete a file. */ |
99 void deleteFile(String fname) { | 99 void deleteFile(String fname) { |
100 var f = new File(fname); | 100 var f = new File(fname); |
101 f.deleteSync(); | 101 f.deleteSync(); |
102 } | 102 } |
| 103 |
| 104 /** Get the name of the layout render file for a test. */ |
| 105 String layoutFileName(String testname) => |
| 106 testname.replaceAll(new RegExp('\.dart\$'), '.render'); |
| 107 |
| 108 /** Check if a test is a layout render test. renders. |
| 109 */ |
| 110 bool isLayoutRenderTest(String testname) { |
| 111 var layoutname = layoutFileName(testname); |
| 112 var f = new File(layoutname); |
| 113 return f.existsSync(); |
| 114 } |
OLD | NEW |