Chromium Code Reviews| 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(); |
| + }; |
| } |