| 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.timing; | 5 library test.timing; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:math'; | 9 import 'dart:math'; |
| 10 | 10 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 * Shut the server down unless [skipShutdown] is `true`. | 305 * Shut the server down unless [skipShutdown] is `true`. |
| 306 */ | 306 */ |
| 307 Future _shutdownIfNeeded() { | 307 Future _shutdownIfNeeded() { |
| 308 if (skipShutdown) { | 308 if (skipShutdown) { |
| 309 return new Future.value(); | 309 return new Future.value(); |
| 310 } | 310 } |
| 311 // Give the server a short time to comply with the shutdown request; if it | 311 // Give the server a short time to comply with the shutdown request; if it |
| 312 // doesn't exit, then forcibly terminate it. | 312 // doesn't exit, then forcibly terminate it. |
| 313 sendServerShutdown(); | 313 sendServerShutdown(); |
| 314 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { | 314 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { |
| 315 return server.kill(); | 315 return server.kill('server failed to exit'); |
| 316 }); | 316 }); |
| 317 } | 317 } |
| 318 } | 318 } |
| OLD | NEW |