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

Unified Diff: tests/isolate/nested_spawn_stream_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/nested_spawn_stream2_test.dart ('k') | tests/isolate/nested_spawn_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/nested_spawn_stream_test.dart
diff --git a/tests/isolate/nested_spawn_stream_test.dart b/tests/isolate/nested_spawn_stream_test.dart
deleted file mode 100644
index bc589ac74c2132dfab3890cdce79ab819249f74d..0000000000000000000000000000000000000000
--- a/tests/isolate/nested_spawn_stream_test.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-// Dart test program for testing that isolates can spawn other isolates.
-
-library NestedSpawnTest;
-import 'dart:isolate';
-import '../../pkg/unittest/lib/unittest.dart';
-
-void isolateA() {
- IsolateSink replyTo;
- bool isFirst = true;
- stream.listen((msg) {
- if (isFirst) {
- isFirst = false;
- replyTo = msg;
- return;
- }
- expect(msg, "launch nested!");
- IsolateSink sink = streamSpawnFunction(isolateB);
- MessageBox box = new MessageBox();
- sink.add(box.sink);
- sink.add("alive?");
- box.stream.single.then((msg) {
- expect(msg, "and kicking");
- replyTo.add(499);
- replyTo.close();
- stream.close();
- });
- });
-}
-
-void isolateB() {
- IsolateSink replyTo;
- bool isFirst = true;
- stream.listen((msg) {
- if (isFirst) {
- isFirst = false;
- replyTo = msg;
- return;
- }
- expect(msg, "alive?");
- replyTo.add("and kicking");
- replyTo.close();
- stream.close();
- });
-}
-
-
-main() {
- test("spawned isolates can spawn nested isolates", () {
- MessageBox box = new MessageBox();
- IsolateSink sink = streamSpawnFunction(isolateA);
- sink.add(box.sink);
- sink.add("launch nested!");
- box.stream.single.then(expectAsync1((msg) {
- expect(msg, 499);
- }));
- });
-}
« no previous file with comments | « tests/isolate/nested_spawn_stream2_test.dart ('k') | tests/isolate/nested_spawn_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698