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

Side by Side Diff: tests/lib/async/catch_errors27_test.dart

Issue 25354003: Redo StreamTransformers so they work with Stack traces. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/lib/async/catch_errors26_test.dart ('k') | tests/lib/async/event_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'package:async_helper/async_helper.dart'; 5 import 'package:async_helper/async_helper.dart';
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import 'dart:async'; 7 import 'dart:async';
8 import 'catch_errors.dart'; 8 import 'catch_errors.dart';
9 9
10 main() { 10 main() {
(...skipping 10 matching lines...) Expand all
21 catchErrors(() { 21 catchErrors(() {
22 catchErrors(() { 22 catchErrors(() {
23 controller = new StreamController(); 23 controller = new StreamController();
24 stream = controller.stream 24 stream = controller.stream
25 .map((x) { 25 .map((x) {
26 events.add("map $x"); 26 events.add("map $x");
27 return x + 100; 27 return x + 100;
28 }) 28 })
29 .asBroadcastStream(); 29 .asBroadcastStream();
30 stream 30 stream
31 .transform(new StreamTransformer( 31 .transform(new StreamTransformer.fromHandlers(
32 handleError: (e, sink) => sink.add("error $e"))) 32 handleError: (e, st, sink) { sink.add("error $e"); }))
33 .listen((x) { events.add("stream $x"); }); 33 .listen((x) { events.add("stream $x"); });
34 runAsync(() { 34 runAsync(() {
35 controller.add(1); 35 controller.add(1);
36 // Errors are not allowed to traverse boundaries, but in this case the 36 // Errors are not allowed to traverse boundaries, but in this case the
37 // first listener of the broadcast stream is in the same error-zone. So 37 // first listener of the broadcast stream is in the same error-zone. So
38 // this should work. 38 // this should work.
39 controller.addError(2); 39 controller.addError(2);
40 controller.close(); 40 controller.close();
41 }); 41 });
42 }).listen((x) { 42 }).listen((x) {
(...skipping 12 matching lines...) Expand all
55 "stream 101", 55 "stream 101",
56 "stream2 101", 56 "stream2 101",
57 "stream error 2", 57 "stream error 2",
58 2, // Caught by the inner `catchErrors`. 58 2, // Caught by the inner `catchErrors`.
59 ], 59 ],
60 events); 60 events);
61 asyncEnd(); 61 asyncEnd();
62 }); 62 });
63 }); 63 });
64 } 64 }
OLDNEW
« no previous file with comments | « tests/lib/async/catch_errors26_test.dart ('k') | tests/lib/async/event_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698