| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 isolate_unhandled_exception_test2; |
| 6 |
| 5 import 'dart:isolate'; | 7 import 'dart:isolate'; |
| 6 import 'dart:io'; | 8 import 'dart:io'; |
| 7 | 9 |
| 8 // Tests that an isolate's keeps message handling working after | 10 // Tests that an isolate's keeps message handling working after |
| 9 // throwing an unhandled exception, if there is a top level callback | 11 // throwing an unhandled exception, if there is a top level callback |
| 10 // method that returns whether to continue handling messages or not. | 12 // method that returns whether to continue handling messages or not. |
| 11 // This test verifies that a default-named callback function is called | 13 // This test verifies that a default-named callback function is called |
| 12 // when no callback is specified in Isolate.spawnFunction. | 14 // when no callback is specified in Isolate.spawnFunction. |
| 13 | 15 |
| 14 // Note: this test will hang if an uncaught exception isn't handled, | 16 // Note: this test will hang if an uncaught exception isn't handled, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 45 print('unhandled exception: ${future.exception}'); | 47 print('unhandled exception: ${future.exception}'); |
| 46 exit(1); | 48 exit(1); |
| 47 } | 49 } |
| 48 if (future.value != 'hello') { | 50 if (future.value != 'hello') { |
| 49 print('unexpected response: ${future.value}'); | 51 print('unexpected response: ${future.value}'); |
| 50 exit(1); | 52 exit(1); |
| 51 } | 53 } |
| 52 exit(0); | 54 exit(0); |
| 53 }); | 55 }); |
| 54 } | 56 } |
| OLD | NEW |