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

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

Issue 8885032: Improve the event handling for string input stream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated the Dart test runner to work with the file input stream changes Created 9 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
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 38afda6fbe2979e3e53933548a05c61d3cc86d75..40d5ed7c6d86b640846e1e73b33d3cd7dc33ecfd 100644
--- a/tools/testing/dart/status_file_parser.dart
+++ b/tools/testing/dart/status_file_parser.dart
@@ -45,20 +45,25 @@ String getDirname(String path) =>
void ReadTestExpectationsInto(TestExpectations expectations,
String statusFilePath,
- environment) {
+ environment,
+ onDone) {
List<Section> sections = new List<Section>();
- ReadConfigurationInto(statusFilePath, sections);
- for (Section section in sections) {
- if (section.isEnabled(environment)) {
- for (var rule in section.testRules) {
- expectations.addRule(rule, environment);
+ void sectionsRead() {
+ for (Section section in sections) {
+ if (section.isEnabled(environment)) {
+ for (var rule in section.testRules) {
+ expectations.addRule(rule, environment);
+ }
}
}
+ onDone();
}
+
+ ReadConfigurationInto(statusFilePath, sections, sectionsRead);
}
-void ReadConfigurationInto(path, sections) {
+void ReadConfigurationInto(path, sections, onDone) {
File file = new File(getFilename(path));
if (!file.existsSync()) return; // TODO(whesse): Handle missing file.
FileInputStream file_stream = file.openInputStream();
@@ -68,6 +73,7 @@ void ReadConfigurationInto(path, sections) {
sections.add(current);
String prefix = "";
+ lines.lineHandler = () {
String line;
Mads Ager (google) 2011/12/09 13:09:33 Indent line 77 to 113.
Søren Gjesse 2011/12/09 13:36:43 Done.
while ((line = lines.readLine()) != null) {
Match match = StripComment.firstMatch(line);
@@ -105,8 +111,12 @@ void ReadConfigurationInto(path, sections) {
print("unmatched line: $line");
}
+ };
- file_stream.close();
+ lines.closeHandler = () {
+ file_stream.close();
+ onDone();
+ };
}

Powered by Google App Engine
This is Rietveld 408576698