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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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
« no previous file with comments | « runtime/tests/vm/dart/isolate_unhandled_exception_test.dart ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_uri_helper; 5 library isolate_unhandled_exception_uri_helper;
6 6
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 8
9 // Tests that isolate code in another script keeps message handling working 9 // Tests that isolate code in another script keeps message handling working
10 // after throwing an unhandled exception, if it has a function called 10 // after throwing an unhandled exception, if it has a function called
11 // unhandledExceptionCallback that returns true (continue handling). 11 // unhandledExceptionCallback that returns true (continue handling).
12 12
13 // Note: this test will hang if an uncaught exception isn't handled, 13 // Note: this test will hang if an uncaught exception isn't handled,
14 // either by an error in the callback or it returning false. 14 // either by an error in the callback or it returning false.
15 15
16 void main() { 16 void main() {
17 var isolate_port = spawnUri('isolate_unhandled_exception_uri_helper.dart'); 17 var isolate_port = spawnUri('isolate_unhandled_exception_uri_helper.dart');
18 18
19 // Send a message that will cause an ignorable exception to be thrown. 19 // Send a message that will cause an ignorable exception to be thrown.
20 Future f = isolate_port.call('throw exception'); 20 Future f = isolate_port.call('throw exception');
21 f.onComplete((future) { 21 f.catchError((error) {
22 Expect.equals(null, future.exception); 22 Expect.fail("Error not expected");
23 }); 23 });
24 24
25 // Verify that isolate can still handle messages. 25 // Verify that isolate can still handle messages.
26 isolate_port.call('hi').onComplete((future) { 26 isolate_port.call('hi').then((value) {
27 Expect.equals(null, future.exception); 27 Expect.equals('hello', value);
28 Expect.equals('hello', future.value); 28 }, onError: (error) {
29 Expect.fail("Error not expected");
29 }); 30 });
30 31
31 } 32 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/isolate_unhandled_exception_test.dart ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698