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

Unified Diff: tests/isolate/isolate_throws_test.dart

Issue 92223003: Clean up isolate tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 1 month 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
« no previous file with comments | « tests/isolate/isolate_negative_test.dart ('k') | tests/isolate/simple_message_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/isolate_throws_test.dart
diff --git a/tests/isolate/isolate2_negative_test.dart b/tests/isolate/isolate_throws_test.dart
similarity index 57%
rename from tests/isolate/isolate2_negative_test.dart
rename to tests/isolate/isolate_throws_test.dart
index fec12d610fb3f8854c01d44cf4e4baf1b752a6b2..aecbe6e1483ea5e17852f91d5f0a1d0d0461b651 100644
--- a/tests/isolate/isolate2_negative_test.dart
+++ b/tests/isolate/isolate_throws_test.dart
@@ -5,18 +5,22 @@
// Dart test program for testing that exceptions in other isolates bring down
// the program.
-library isolate2_negative_test;
+import 'dart:async';
import 'dart:isolate';
import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
-void entry(msg) {
- throw "foo";
+void entry(SendPort replyTo) {
+ throw "foo"; /// 01: runtime error
+ replyTo.send("done");
}
main() {
- // We start an asynchronous operation, but since we don't expect to get
- // anything back except an exception there is no asyncEnd().
- // If the exception is not thrown this test will timeout.
asyncStart();
- Isolate.spawn(entry, null);
+ ReceivePort rp = new ReceivePort();
+ Isolate.spawn(entry, rp.sendPort);
+ rp.first.then((msg) {
+ Expect.equals("done", msg);
+ asyncEnd();
+ });
}
« no previous file with comments | « tests/isolate/isolate_negative_test.dart ('k') | tests/isolate/simple_message_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698