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

Unified Diff: tests/isolate/browser/compute_this_script_browser_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: tests/isolate/browser/compute_this_script_browser_test.dart
diff --git a/tests/isolate/browser/compute_this_script_browser_test.dart b/tests/isolate/browser/compute_this_script_browser_test.dart
index 74cd118e6f8d2b5b28df411d1f4c1870de81bd3c..2b71451aeefbc1139acf582dfc392672b62e1819 100644
--- a/tests/isolate/browser/compute_this_script_browser_test.dart
+++ b/tests/isolate/browser/compute_this_script_browser_test.dart
@@ -12,11 +12,10 @@ import 'dart:isolate';
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
-child() {
- port.receive((msg, reply) {
- reply.send('re: $msg');
- port.close();
- });
+child(var message) {
+ var data = message[0];
+ var reply = message[1];
+ reply.send('re: $data');
}
main() {
@@ -25,12 +24,11 @@ main() {
document.body.append(script);
test('spawn with other script tags in page', () {
ReceivePort port = new ReceivePort();
- port.receive(expectAsync2((msg, _) {
+ port.listen(expectAsync1((msg) {
expect(msg, equals('re: hi'));
port.close();
}));
- SendPort s = spawnFunction(child);
- s.send('hi', port.toSendPort());
+ Isolate.spawn(child, ['hi', port.sendPort]);
});
}
« no previous file with comments | « tests/isolate/browser/compute_this_script_browser_stream_test.dart ('k') | tests/isolate/browser/typed_data_message_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698