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

Unified Diff: tests/isolate/global_error_handler_stream_test.dart

Issue 12919011: Remove streamSpawnUri and mangler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 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/global_error_handler_stream2_test.dart ('k') | tests/isolate/illegal_msg_stream_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/global_error_handler_stream_test.dart
diff --git a/tests/isolate/global_error_handler_test.dart b/tests/isolate/global_error_handler_stream_test.dart
similarity index 67%
copy from tests/isolate/global_error_handler_test.dart
copy to tests/isolate/global_error_handler_stream_test.dart
index cbb659a2becab5df1518b4c40bccd462170e1b0b..6c2b59cfe800c828aa40194e4fc3b617395614e0 100644
--- a/tests/isolate/global_error_handler_test.dart
+++ b/tests/isolate/global_error_handler_stream_test.dart
@@ -17,14 +17,14 @@ void runFunctions() {
}
}
-void startTest(SendPort finishPort, replyPort) {
+void startTest(StreamSink finishSink) {
firstFunction = () { throw new RuntimeError("ignore exception"); };
- finishFunction = () { finishPort.send("done"); };
+ finishFunction = () { finishSink.add("done"); finishPort.close(); };
new Timer(Duration.ZERO, runFunctions);
}
runTest() {
- port.receive(startTest);
+ stream.single.then(startTest);
}
bool globalErrorHandler(IsolateUnhandledException e) {
@@ -32,10 +32,14 @@ bool globalErrorHandler(IsolateUnhandledException e) {
}
main() {
- var port = new ReceivePort();
+ var box = new MessageBox();
var timer;
- SendPort otherIsolate = spawnFunction(runTest, globalErrorHandler);
- otherIsolate.send(port.toSendPort());
- port.receive((msg, replyPort) { port.close(); timer.cancel(); });
+ StreamSink otherIsolate = streamSpawnFunction(runTest, globalErrorHandler);
+ otherIsolate.add(box.sink);
+ otherIsolate.close();
+ box.stream.single.then((msg) {
+ box.stream.close();
+ timer.cancel();
+ });
timer = new Timer(const Duration(seconds: 2), () { throw "failed"; });
}
« no previous file with comments | « tests/isolate/global_error_handler_stream2_test.dart ('k') | tests/isolate/illegal_msg_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698