| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 /** | 179 /** |
| 180 * If [skipShutdown] is not set, shut down the server. | 180 * If [skipShutdown] is not set, shut down the server. |
| 181 */ | 181 */ |
| 182 Future _shutdownIfNeeded() { | 182 Future _shutdownIfNeeded() { |
| 183 if (skipShutdown) { | 183 if (skipShutdown) { |
| 184 return new Future.value(); | 184 return new Future.value(); |
| 185 } | 185 } |
| 186 // Give the server a short time to comply with the shutdown request; if it | 186 // Give the server a short time to comply with the shutdown request; if it |
| 187 // doesn't exit, then forcibly terminate it. | 187 // doesn't exit, then forcibly terminate it. |
| 188 Completer processExited = new Completer(); | |
| 189 sendServerShutdown(); | 188 sendServerShutdown(); |
| 190 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { | 189 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { |
| 191 return server.kill(); | 190 return server.kill(); |
| 192 }); | 191 }); |
| 193 } | 192 } |
| 194 } | 193 } |
| 195 | 194 |
| 196 final Matcher isResponse = new MatchesJsonObject('response', { | 195 final Matcher isResponse = new MatchesJsonObject('response', { |
| 197 'id': isString | 196 'id': isString |
| 198 }, optionalFields: { | 197 }, optionalFields: { |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 */ | 871 */ |
| 873 void _recordStdio(String line) { | 872 void _recordStdio(String line) { |
| 874 double elapsedTime = _time.elapsedTicks / _time.frequency; | 873 double elapsedTime = _time.elapsedTicks / _time.frequency; |
| 875 line = "$elapsedTime: $line"; | 874 line = "$elapsedTime: $line"; |
| 876 if (_debuggingStdio) { | 875 if (_debuggingStdio) { |
| 877 print(line); | 876 print(line); |
| 878 } | 877 } |
| 879 _recordedStdio.add(line); | 878 _recordedStdio.add(line); |
| 880 } | 879 } |
| 881 } | 880 } |
| OLD | NEW |