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

Unified Diff: tests/isolate/spawn_function_custom_class_test.dart

Issue 43663003: dart2js. (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: tests/isolate/spawn_function_custom_class_test.dart
diff --git a/tests/isolate/spawn_function_custom_class_test.dart b/tests/isolate/spawn_function_custom_class_test.dart
index 78c3042e536168dfaac67a2cac99ec51c22f2c90..2369899a5357be173b50bcdf4d39e4d2d9eff148 100644
--- a/tests/isolate/spawn_function_custom_class_test.dart
+++ b/tests/isolate/spawn_function_custom_class_test.dart
@@ -18,21 +18,19 @@ class MyClass {
}
}
-child() {
- port.receive((msg, reply) {
- reply.send('re: ${new MyClass().myFunc(msg)}');
- });
+child(args) {
+ var reply = args[1];
+ var msg = args[0];
+ reply.send('re: ${new MyClass().myFunc(msg)}');
}
main() {
test('message - reply chain', () {
ReceivePort port = new ReceivePort();
- port.receive((msg, _) {
+ port.listen((msg) {
port.close();
expect(msg, equals('re: hi there'));
});
-
- SendPort s = spawnFunction(child);
- s.send('hi', port.toSendPort());
+ Isolate.spawn(child, ['hi', port.sendPort]);
});
}

Powered by Google App Engine
This is Rietveld 408576698