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

Unified Diff: tools/testing/dart/status_file_parser.dart

Issue 9432023: Add both sync and async methods for getting streams for a File (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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
Index: tools/testing/dart/status_file_parser.dart
diff --git a/tools/testing/dart/status_file_parser.dart b/tools/testing/dart/status_file_parser.dart
index 58e24831d55f2c2d489390d7f14cbcd02d3cc9b1..68b2b240ab3bec58c7671510c857fdb6243f22fc 100644
--- a/tools/testing/dart/status_file_parser.dart
+++ b/tools/testing/dart/status_file_parser.dart
@@ -59,7 +59,14 @@ void ReadConfigurationInto(path, sections, onDone) {
if (!file.existsSync()) {
throw new Exception('Cannot find test status file $path');
}
- InputStream file_stream = file.openInputStream();
+ // TODO(XXX): When the checked in binary is updated to include the
Mads Ager (google) 2012/02/22 13:20:20 Will you do this as part of committing this?
Søren Gjesse 2012/02/22 14:03:18 No, I would rather postpone until after finishing
+ // openInputStreamSync API remove this try/catch.
+ InputStream file_stream;
+ try {
+ file_stream = file.openInputStreamSync();
+ } catch (NoSuchMethodException e) {
+ file_stream = file.openInputStream();
+ }
StringInputStream lines = new StringInputStream(file_stream);
Section current = new Section.always();
« tests/standalone/src/FileOutputStreamTest.dart ('K') | « tests/standalone/src/StreamPipeTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698