| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 */ | 188 */ |
| 189 Future oneTimeSetUp() { | 189 Future oneTimeSetUp() { |
| 190 initializeInttestMixin(); | 190 initializeInttestMixin(); |
| 191 server = new Server(); | 191 server = new Server(); |
| 192 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); | 192 sourceDirectory = Directory.systemTemp.createTempSync('analysisServer'); |
| 193 Completer serverConnected = new Completer(); | 193 Completer serverConnected = new Completer(); |
| 194 onServerConnected.listen((_) { | 194 onServerConnected.listen((_) { |
| 195 serverConnected.complete(); | 195 serverConnected.complete(); |
| 196 }); | 196 }); |
| 197 skipShutdown = true; | 197 skipShutdown = true; |
| 198 return server.start(/*profileServer: true*/).then((params) { | 198 return server.start(/*profileServer: true*/).then((_) { |
| 199 server.listenToOutput(dispatchNotification); | 199 server.listenToOutput(dispatchNotification); |
| 200 server.exitCode.then((_) { | 200 server.exitCode.then((_) { |
| 201 skipShutdown = true; | 201 skipShutdown = true; |
| 202 }); | 202 }); |
| 203 return serverConnected.future; | 203 return serverConnected.future; |
| 204 }); | 204 }); |
| 205 } | 205 } |
| 206 | 206 |
| 207 /** | 207 /** |
| 208 * Perform any operations that need to be performed once after all iterations. | 208 * Perform any operations that need to be performed once after all iterations. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 return new Future.value(); | 305 return new Future.value(); |
| 306 } | 306 } |
| 307 // Give the server a short time to comply with the shutdown request; if it | 307 // Give the server a short time to comply with the shutdown request; if it |
| 308 // doesn't exit, then forcibly terminate it. | 308 // doesn't exit, then forcibly terminate it. |
| 309 sendServerShutdown(); | 309 sendServerShutdown(); |
| 310 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { | 310 return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () { |
| 311 return server.kill('server failed to exit'); | 311 return server.kill('server failed to exit'); |
| 312 }); | 312 }); |
| 313 } | 313 } |
| 314 } | 314 } |
| OLD | NEW |