Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: runtime/tests/vm/dart/isolate_unhandled_exception_uri_test.dart

Issue 11558034: Second version of support for specifying an unhandled exception callback (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 import 'dart:isolate';
2 import 'dart:io';
3
4 // Tests that isolate code in another script keeps message handling working
5 // after throwing an unhandled exception, if it has a function called
6 // unhandledExceptionCallback that returns true (continue handling).
7
8 // Note: this test will hang if an uncaught exception isn't handled,
9 // either by an error in the callback or it returning false.
10
11 void main() {
12 var isolate_port = spawnUri('isolate_unhandled_exception_uri_helper.dart');
13
14 // Send a message that will cause an ignorable exception to be thrown.
15 Future f = isolate_port.call('throw exception');
16 f.onComplete((future) {
17 // Exception wasn't ignored as it was supposed to be.
18 print('failed handling exception');
19 exit(1);
20 });
21
22 // Verify that isolate can still handle messages.
23 isolate_port.call('hi').onComplete((future) {
24 if (future.exception != null) {
25 print('unhandled exception: ${future.exception}');
26 exit(1);
27 }
28 if (future.value != 'hello') {
29 print('unexpected response: ${future.value}');
30 exit(1);
31 }
32 exit(0);
33 });
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698