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'); |
} |