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

Unified Diff: tests/isolate/illegal_msg_stream_test.dart

Issue 12919011: Remove streamSpawnUri and mangler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase 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
Index: tests/isolate/illegal_msg_stream_test.dart
diff --git a/tests/isolate/illegal_msg_test.dart b/tests/isolate/illegal_msg_stream_test.dart
similarity index 51%
copy from tests/isolate/illegal_msg_test.dart
copy to tests/isolate/illegal_msg_stream_test.dart
index 51b442ccdc8a6bd612039a2bf568daed62c1bca4..b9e0a0d21603317d062beed3ff5a30bb2ba91213 100644
--- a/tests/isolate/illegal_msg_test.dart
+++ b/tests/isolate/illegal_msg_stream_test.dart
@@ -2,32 +2,31 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library illegal_msg_tests;
import 'dart:isolate';
funcFoo(x) => x + 2;
-echo() {
- port.receive((msg, reply) {
- reply.send("echoing ${msg(1)}}");
+foo() {
+ stream.single.then((msg) {
+ IsolateSink sink = msg;
+ sink.add(499);
+ sink.close();
});
}
main() {
- var snd = spawnFunction(echo);
+ var box = new MessageBox();
+ var snd = streamSpawnFunction(foo);
var caught_exception = false;
try {
- snd.send(funcFoo, port.toSendPort());
+ snd.add(funcFoo);
} catch (e) {
caught_exception = true;
}
+ snd.add(box.sink);
+ snd.close();
- if (caught_exception) {
- port.close();
- } else {
- port.receive((msg, reply) {
- print("from worker ${msg}");
- });
- }
- Expect.isTrue(caught_exception);
+ box.stream.single.then((msg) {
Lasse Reichstein Nielsen 2013/03/19 12:01:55 expectAsync?
floitsch 2013/03/19 13:18:59 This test doesn't import the unit-test library. In
+ Expect.equals(499, msg);
+ });
}

Powered by Google App Engine
This is Rietveld 408576698