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

Side by Side Diff: tests/isolate/illegal_msg_stream_test.dart

Issue 23701010: Switch to async_helper package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and adapt 3 new tests. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test; 5 library test;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 import '../async_helper.dart'; 9 import "package:async_helper/async_helper.dart";
10 10
11 funcFoo(x) => x + 2; 11 funcFoo(x) => x + 2;
12 12
13 foo() { 13 foo() {
14 stream.single.then((msg) { 14 stream.single.then((msg) {
15 IsolateSink sink = msg; 15 IsolateSink sink = msg;
16 sink.add(499); 16 sink.add(499);
17 sink.close(); 17 sink.close();
18 }); 18 });
19 } 19 }
20 20
21 main() { 21 main() {
22 var box = new MessageBox(); 22 var box = new MessageBox();
23 var snd = streamSpawnFunction(foo); 23 var snd = streamSpawnFunction(foo);
24 var caught_exception = false; 24 var caught_exception = false;
25 try { 25 try {
26 snd.add(funcFoo); 26 snd.add(funcFoo);
27 } catch (e) { 27 } catch (e) {
28 caught_exception = true; 28 caught_exception = true;
29 } 29 }
30 snd.add(box.sink); 30 snd.add(box.sink);
31 snd.close(); 31 snd.close();
32 32
33 asyncStart(); 33 asyncStart();
34 box.stream.single.then((msg) { 34 box.stream.single.then((msg) {
35 Expect.equals(499, msg); 35 Expect.equals(499, msg);
36 asyncEnd(); 36 asyncEnd();
37 }); 37 });
38 } 38 }
OLDNEW
« no previous file with comments | « tests/isolate/global_error_handler_stream2_test.dart ('k') | tests/isolate/illegal_msg_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698