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_test; | 5 library isolate_unhandled_exception_test; |
6 | 6 |
7 import "package:expect/expect.dart"; | |
8 import 'dart:async'; | 7 import 'dart:async'; |
9 import 'dart:isolate'; | 8 import 'dart:isolate'; |
10 | 9 |
11 // Tests that an isolate's keeps message handling working after | 10 // Tests that an isolate's keeps message handling working after |
12 // throwing an unhandled exception, if it was created with an | 11 // throwing an unhandled exception, if it was created with an |
13 // unhandled exception callback that returns true (continue handling). | 12 // unhandled exception callback that returns true (continue handling). |
14 // This test verifies that a callback function specified in | 13 // This test verifies that a callback function specified in |
15 // Isolate.spawnFunction is called. | 14 // Isolate.spawnFunction is called. |
16 | 15 |
17 // 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 24 matching lines...) Expand all Loading... |
42 Expect.fail("Error not expected"); | 41 Expect.fail("Error not expected"); |
43 }); | 42 }); |
44 | 43 |
45 // Verify that isolate can still handle messages. | 44 // Verify that isolate can still handle messages. |
46 isolate_port.call('hi').then((value) { | 45 isolate_port.call('hi').then((value) { |
47 Expect.equals('hello', value); | 46 Expect.equals('hello', value); |
48 }, onError: (error) { | 47 }, onError: (error) { |
49 Expect.fail("Error not expected"); | 48 Expect.fail("Error not expected"); |
50 }); | 49 }); |
51 } | 50 } |
OLD | NEW |