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

Unified Diff: tests/isolate/isolate_stress_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
« no previous file with comments | « tests/isolate/isolate_negative_test.dart ('k') | tests/isolate/mandel_isolate_stream_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/isolate_stress_test.dart
diff --git a/tests/isolate/isolate_stress_test.dart b/tests/isolate/isolate_stress_test.dart
index f00e4573e397cd2dcf6f43b508cf84ecd7056fef..8a76b027942094d0e03a41aee84a81f40a49f6b6 100644
--- a/tests/isolate/isolate_stress_test.dart
+++ b/tests/isolate/isolate_stress_test.dart
@@ -12,11 +12,8 @@ import 'dart:isolate';
// TODO(12588): Remove this import when we have wrapper-less testing.
import 'dart:html';
-worker() {
- port.receive((String uri, SendPort replyTo) {
- replyTo.send('Hello from Worker');
- port.close();
- });
+worker(SendPort replyTo) {
+ replyTo.send('Hello from Worker');
}
main() {
@@ -33,11 +30,12 @@ main() {
throw new Exception('Unexpected reply from worker: $reply');
}
if (++isolateCount > 200) {
- port.close();
window.postMessage('unittest-suite-success', '*');
return;
}
- spawnFunction(worker).call('').then(spawnMany);
+ ReceivePort response = new ReceivePort();
+ var remote = Isolate.spawn(worker, response.sendPort);
+ remote.then((_) => response.first).then(spawnMany);
print('isolateCount = $isolateCount');
}
« no previous file with comments | « tests/isolate/isolate_negative_test.dart ('k') | tests/isolate/mandel_isolate_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698