| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.integration.analysis; | 5 library test.integration.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); | 147 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); |
| 148 | 148 |
| 149 onAnalysisErrors.listen((AnalysisErrorsParams params) { | 149 onAnalysisErrors.listen((AnalysisErrorsParams params) { |
| 150 currentAnalysisErrors[params.file] = params.errors; | 150 currentAnalysisErrors[params.file] = params.errors; |
| 151 }); | 151 }); |
| 152 Completer serverConnected = new Completer(); | 152 Completer serverConnected = new Completer(); |
| 153 onServerConnected.listen((_) { | 153 onServerConnected.listen((_) { |
| 154 expect(serverConnected.isCompleted, isFalse); | 154 expect(serverConnected.isCompleted, isFalse); |
| 155 serverConnected.complete(); | 155 serverConnected.complete(); |
| 156 }); | 156 }); |
| 157 onServerError.listen((ServerErrorParams params) { |
| 158 // A server error should never happen during an integration test. |
| 159 fail(params.message); |
| 160 }); |
| 157 return server.start().then((_) { | 161 return server.start().then((_) { |
| 158 server.listenToOutput(dispatchNotification); | 162 server.listenToOutput(dispatchNotification); |
| 159 server.exitCode.then((_) { | 163 server.exitCode.then((_) { |
| 160 skipShutdown = true; | 164 skipShutdown = true; |
| 161 }); | 165 }); |
| 162 return serverConnected.future; | 166 return serverConnected.future; |
| 163 }); | 167 }); |
| 164 } | 168 } |
| 165 | 169 |
| 166 /** | 170 /** |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 */ | 872 */ |
| 869 void _recordStdio(String line) { | 873 void _recordStdio(String line) { |
| 870 double elapsedTime = _time.elapsedTicks / _time.frequency; | 874 double elapsedTime = _time.elapsedTicks / _time.frequency; |
| 871 line = "$elapsedTime: $line"; | 875 line = "$elapsedTime: $line"; |
| 872 if (_debuggingStdio) { | 876 if (_debuggingStdio) { |
| 873 print(line); | 877 print(line); |
| 874 } | 878 } |
| 875 _recordedStdio.add(line); | 879 _recordedStdio.add(line); |
| 876 } | 880 } |
| 877 } | 881 } |
| OLD | NEW |