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 // The following set of variables should be set by the caller that | 5 // The following set of variables should be set by the caller that |
6 // #sources this file. | 6 // #sources this file. |
7 /** Whether to include elapsed time. */ | 7 /** Whether to include elapsed time. */ |
8 | 8 |
9 part of test_controller; | 9 part of test_controller; |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 if (label == 'NONEXISTENT') { | 157 if (label == 'NONEXISTENT') { |
158 complete(); | 158 complete(); |
159 } | 159 } |
160 } else if (stdout[i].startsWith(contentMarker)) { | 160 } else if (stdout[i].startsWith(contentMarker)) { |
161 if (label == null) { | 161 if (label == null) { |
162 complete(); | 162 complete(); |
163 } | 163 } |
164 var expectedFileName = | 164 var expectedFileName = |
165 '$sourceDir${Platform.pathSeparator}' | 165 '$sourceDir${Platform.pathSeparator}' |
166 '${label.replaceAll("###", "_") | 166 '${label.replaceAll("###", "_") |
167 .replaceAll(new RegExp("[^A-Za-z0-9]"),"_")}.txt'; | 167 .replaceAll(const RegExp("[^A-Za-z0-9]"),"_")}.txt'; |
168 var expected = new File(expectedFileName); | 168 var expected = new File(expectedFileName); |
169 if (regenerate) { | 169 if (regenerate) { |
170 var ostream = expected.openOutputStream(FileMode.WRITE); | 170 var ostream = expected.openOutputStream(FileMode.WRITE); |
171 while (i < stdout.length) { | 171 while (i < stdout.length) { |
172 ostream.writeString(stdout[i]); | 172 ostream.writeString(stdout[i]); |
173 ostream.writeString('\n'); | 173 ostream.writeString('\n'); |
174 i++; | 174 i++; |
175 } | 175 } |
176 ostream.close(); | 176 ostream.close(); |
177 pass(start, label); | 177 pass(start, label); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 } else if (line.startsWith(contentMarker)) { | 254 } else if (line.startsWith(contentMarker)) { |
255 if (label == null) { | 255 if (label == null) { |
256 complete(); | 256 complete(); |
257 } | 257 } |
258 var len = int.parse(line.substring(contentMarker.length)); | 258 var len = int.parse(line.substring(contentMarker.length)); |
259 pos = idx + 1; | 259 pos = idx + 1; |
260 var expectedFileName = | 260 var expectedFileName = |
261 '$sourceDir${Platform.pathSeparator}' | 261 '$sourceDir${Platform.pathSeparator}' |
262 '${label.replaceAll("###","_"). | 262 '${label.replaceAll("###","_"). |
263 replaceAll(new RegExp("[^A-Za-z0-9]"),"_")}.png'; | 263 replaceAll(const RegExp("[^A-Za-z0-9]"),"_")}.png'; |
264 var expected = new File(expectedFileName); | 264 var expected = new File(expectedFileName); |
265 if (regenerate) { | 265 if (regenerate) { |
266 var ostream = expected.openOutputStream(FileMode.WRITE); | 266 var ostream = expected.openOutputStream(FileMode.WRITE); |
267 ostream.writeFrom(stdout, pos, len); | 267 ostream.writeFrom(stdout, pos, len); |
268 ostream.close(); | 268 ostream.close(); |
269 pass(start, label); | 269 pass(start, label); |
270 } else if (!expected.existsSync()) { | 270 } else if (!expected.existsSync()) { |
271 fail(start, label, 'No expectation file'); | 271 fail(start, label, 'No expectation file'); |
272 } else { | 272 } else { |
273 var bytes = expected.readAsBytesSync(); | 273 var bytes = expected.readAsBytesSync(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 void runPixelLayoutTests() { | 314 void runPixelLayoutTests() { |
315 init(); | 315 init(); |
316 runPixelLayoutTest(0); | 316 runPixelLayoutTest(0); |
317 } | 317 } |
318 | 318 |
319 void runTextLayoutTests() { | 319 void runTextLayoutTests() { |
320 init(); | 320 init(); |
321 runTextLayoutTest(0); | 321 runTextLayoutTest(0); |
322 } | 322 } |
OLD | NEW |