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

Unified Diff: tests/isolate/simple_message_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_throws_test.dart ('k') | tests/isolate/spawn_function_negative_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/simple_message_test.dart
diff --git a/tests/isolate/isolate_negative_test.dart b/tests/isolate/simple_message_test.dart
similarity index 55%
rename from tests/isolate/isolate_negative_test.dart
rename to tests/isolate/simple_message_test.dart
index e40d23e995d9f303bea93fd33cc778f941628e8d..8338bd6eaa4d80a5c470dd9cef9350b87c6c0781 100644
--- a/tests/isolate/isolate_negative_test.dart
+++ b/tests/isolate/simple_message_test.dart
@@ -7,18 +7,20 @@
library IsolateNegativeTest;
import "package:expect/expect.dart";
import 'dart:isolate';
-import '../../pkg/unittest/lib/unittest.dart';
+import "package:async_helper/async_helper.dart";
void entry(SendPort replyTo) {
- replyTo.send("foo");
+ var message = "foo";
+ message = "bar"; /// 01: runtime error
+ replyTo.send(message);
}
main() {
- test("ensure isolate code is executed", () {
- ReceivePort response = new ReceivePort();
- Isolate.spawn(entry, response.sendPort);
- response.first.then(expectAsync1((message) {
- expect("Expected fail", isTrue); // <=-------- Should fail here.
- }));
+ asyncStart();
+ ReceivePort response = new ReceivePort();
+ Isolate.spawn(entry, response.sendPort);
+ response.first.then((message) {
+ Expect.equals("foo", message);
+ asyncEnd();
});
}
« no previous file with comments | « tests/isolate/isolate_throws_test.dart ('k') | tests/isolate/spawn_function_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698