| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'dart:isolate'; | 5 import 'dart:isolate'; |
| 6 import "package:unittest/unittest.dart"; |
| 7 import "remote_unittest_helper.dart"; |
| 6 | 8 |
| 7 main() { | 9 void main([args, port]) { |
| 8 ReceivePort reply = new ReceivePort(); | 10 if (testRemote(main, port)) return; |
| 9 Isolate.spawn(runTest, reply.sendPort); | 11 test("stacktrace_message", () { |
| 10 reply.first.then((StackTrace stack) { | 12 ReceivePort reply = new ReceivePort(); |
| 11 print(stack); | 13 Isolate.spawn(runTest, reply.sendPort); |
| 14 reply.first.then(expectAsync1((StackTrace stack) { |
| 15 print(stack); |
| 16 })); |
| 12 }); | 17 }); |
| 13 } | 18 } |
| 14 | 19 |
| 15 runTest(SendPort sendport) { | 20 runTest(SendPort sendport) { |
| 16 try { | 21 try { |
| 17 throw 'sorry'; | 22 throw 'sorry'; |
| 18 } catch (e, stack) { | 23 } catch (e, stack) { |
| 19 try { | 24 try { |
| 20 sendport.send(stack); | 25 sendport.send(stack); |
| 21 print("Stacktrace sent"); | 26 print("Stacktrace sent"); |
| 22 } catch (e) { | 27 } catch (e) { |
| 23 print("Stacktrace not sent"); | 28 print("Stacktrace not sent"); |
| 24 sendport.send(null); | 29 sendport.send(null); |
| 25 } | 30 } |
| 26 } | 31 } |
| 27 } | 32 } |
| OLD | NEW |