| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 unittest.runner.vm.isolate_test; | 5 library unittest.runner.vm.isolate_test; |
| 6 | 6 |
| 7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
| 8 | 8 |
| 9 import '../../backend/live_test.dart'; | 9 import '../../backend/live_test.dart'; |
| 10 import '../../backend/live_test_controller.dart'; | 10 import '../../backend/live_test_controller.dart'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 receivePort.listen((message) { | 40 receivePort.listen((message) { |
| 41 if (message['type'] == 'error') { | 41 if (message['type'] == 'error') { |
| 42 var asyncError = RemoteException.deserialize(message['error']); | 42 var asyncError = RemoteException.deserialize(message['error']); |
| 43 controller.addError(asyncError.error, asyncError.stackTrace); | 43 controller.addError(asyncError.error, asyncError.stackTrace); |
| 44 } else if (message['type'] == 'state-change') { | 44 } else if (message['type'] == 'state-change') { |
| 45 controller.setState( | 45 controller.setState( |
| 46 new State( | 46 new State( |
| 47 new Status.parse(message['status']), | 47 new Status.parse(message['status']), |
| 48 new Result.parse(message['result']))); | 48 new Result.parse(message['result']))); |
| 49 } else if (message['type'] == 'print') { |
| 50 controller.print(message['line']); |
| 49 } else { | 51 } else { |
| 50 assert(message['type'] == 'complete'); | 52 assert(message['type'] == 'complete'); |
| 51 controller.completer.complete(); | 53 controller.completer.complete(); |
| 52 } | 54 } |
| 53 }); | 55 }); |
| 54 }, onClose: () { | 56 }, onClose: () { |
| 55 if (receivePort != null) receivePort.close(); | 57 if (receivePort != null) receivePort.close(); |
| 56 }); | 58 }); |
| 57 return controller.liveTest; | 59 return controller.liveTest; |
| 58 } | 60 } |
| 59 } | 61 } |
| OLD | NEW |