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

Unified Diff: runtime/tests/vm/dart/isolate_unhandled_exception_test.dart

Issue 27215002: Very simple version of Isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: runtime/tests/vm/dart/isolate_unhandled_exception_test.dart
diff --git a/runtime/tests/vm/dart/isolate_unhandled_exception_test.dart b/runtime/tests/vm/dart/isolate_unhandled_exception_test.dart
deleted file mode 100644
index 798221e190ddb47f55537761b05bdef71185bd24..0000000000000000000000000000000000000000
--- a/runtime/tests/vm/dart/isolate_unhandled_exception_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library isolate_unhandled_exception_test;
-
-import "package:expect/expect.dart";
-import 'dart:async';
-import 'dart:isolate';
-
-// Tests that an isolate's keeps message handling working after
-// throwing an unhandled exception, if it was created with an
-// unhandled exception callback that returns true (continue handling).
-// This test verifies that a callback function specified in
-// Isolate.spawnFunction is called.
-
-// Note: this test will hang if an uncaught exception isn't handled,
-// either by an error in the callback or it returning false.
-
-void entry() {
- port.receive((message, replyTo) {
- if (message == 'throw exception') {
- replyTo.call('throwing exception');
- throw new UnsupportedError('ignore this exception');
- }
- replyTo.call('hello');
- port.close();
- });
-}
-
-bool exceptionCallback(IsolateUnhandledException e) {
- return e.source.message == 'ignore this exception';
-}
-
-void main() {
- var isolate_port = spawnFunction(entry, exceptionCallback);
-
- // Send a message that will cause an ignorable exception to be thrown.
- Future f = isolate_port.call('throw exception');
- f.catchError((error) {
- // Exception wasn't ignored as it was supposed to be.
- Expect.fail("Error not expected");
- });
-
- // Verify that isolate can still handle messages.
- isolate_port.call('hi').then((value) {
- Expect.equals('hello', value);
- }, onError: (error) {
- Expect.fail("Error not expected");
- });
-}
« no previous file with comments | « runtime/tests/vm/dart/isolate_mirror_remote_test.dart ('k') | runtime/tests/vm/dart/isolate_unhandled_exception_test2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698