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

Unified Diff: runtime/tests/vm/dart/isolate_unhandled_exception_test2.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_test2.dart
diff --git a/runtime/tests/vm/dart/isolate_unhandled_exception_test2.dart b/runtime/tests/vm/dart/isolate_unhandled_exception_test2.dart
deleted file mode 100644
index 7fe1c86de2da4fee1c54731dc75ae956e369bc07..0000000000000000000000000000000000000000
--- a/runtime/tests/vm/dart/isolate_unhandled_exception_test2.dart
+++ /dev/null
@@ -1,49 +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_test2;
-
-import 'dart:isolate';
-
-// Tests that an isolate's keeps message handling working after
-// throwing an unhandled exception, if there is a top level callback
-// method that returns whether to continue handling messages or not.
-// This test verifies that a default-named callback function is called
-// when no callback is specified in Isolate.spawnFunction.
-
-// 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 _unhandledExceptionCallback(IsolateUnhandledException e) {
- return e.source.message == 'ignore this exception';
-}
-
-void main() {
- var isolate_port = spawnFunction(entry);
-
- // Send a message that will cause an ignorable exception to be thrown.
- Future f = isolate_port.call('throw exception');
- f.onComplete((future) {
- // Exception wasn't ignored as it was supposed to be.
- Expect.equals(null, future.exception);
- });
-
- // Verify that isolate can still handle messages.
- isolate_port.call('hi').onComplete((future) {
- Expect.equals(null, future.exception);
- Expect.equals('hello', future.value);
- });
-
-}

Powered by Google App Engine
This is Rietveld 408576698