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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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
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 "package:expect/expect.dart";
7 import 'dart:async'; 8 import 'dart:async';
8 import 'dart:isolate'; 9 import 'dart:isolate';
9 10
10 // Tests that isolate code in another script keeps message handling working 11 // Tests that isolate code in another script keeps message handling working
11 // after throwing an unhandled exception, if it has a function called 12 // after throwing an unhandled exception, if it has a function called
12 // unhandledExceptionCallback that returns true (continue handling). 13 // unhandledExceptionCallback that returns true (continue handling).
13 14
14 // Note: this test will hang if an uncaught exception isn't handled, 15 // Note: this test will hang if an uncaught exception isn't handled,
15 // either by an error in the callback or it returning false. 16 // either by an error in the callback or it returning false.
16 17
17 void main() { 18 void main() {
18 var isolate_port = spawnUri('isolate_unhandled_exception_uri_helper.dart'); 19 var isolate_port = spawnUri('isolate_unhandled_exception_uri_helper.dart');
19 20
20 // Send a message that will cause an ignorable exception to be thrown. 21 // Send a message that will cause an ignorable exception to be thrown.
21 Future f = isolate_port.call('throw exception'); 22 Future f = isolate_port.call('throw exception');
22 f.catchError((error) { 23 f.catchError((error) {
23 Expect.fail("Error not expected"); 24 Expect.fail("Error not expected");
24 }); 25 });
25 26
26 // Verify that isolate can still handle messages. 27 // Verify that isolate can still handle messages.
27 isolate_port.call('hi').then((value) { 28 isolate_port.call('hi').then((value) {
28 Expect.equals('hello', value); 29 Expect.equals('hello', value);
29 }, onError: (error) { 30 }, onError: (error) {
30 Expect.fail("Error not expected"); 31 Expect.fail("Error not expected");
31 }); 32 });
32 33
33 } 34 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/isolate_unhandled_exception_test.dart ('k') | runtime/tests/vm/dart/optimized_stacktrace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698