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

Unified Diff: tests/lib/async/stream_controller_test.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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/lib/async/stream_controller_async_test.dart ('k') | tests/lib/async/stream_event_transform_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/stream_controller_test.dart
diff --git a/tests/lib/async/stream_controller_test.dart b/tests/lib/async/stream_controller_test.dart
index bd830b4ff877b1c8b95bc54a66dc708a43aed214..7dbdbe19076963da794037ca5954c820e1630d9a 100644
--- a/tests/lib/async/stream_controller_test.dart
+++ b/tests/lib/async/stream_controller_test.dart
@@ -62,10 +62,10 @@ testMultiController() {
c = new StreamController.broadcast();
expectedEvents = new Events()..add("ab")..error("[foo]");
sentEvents = new Events()..add("ab")..error("foo")..add("ab")..close();
- actualEvents = new Events.capture(c.stream.handleError((v) {
- if (v.error is String) {
- throw new AsyncError("[${v.error}]",
- "other stack");
+ actualEvents = new Events.capture(c.stream.handleError((error) {
+ if (error is String) {
+ // TODO(floitsch): this test originally changed the stacktrace.
+ throw "[${error}]";
}
}), cancelOnError: true);
sentEvents.replay(c);
@@ -95,8 +95,8 @@ testMultiController() {
new Events()..error("a")..add(42)..error("b")..add("foo")..close();
actualEvents = new Events.capture(c.stream.transform(
new StreamTransformer(
- handleData: (v, s) { s.addError(new AsyncError(v)); },
- handleError: (e, s) { s.add(e.error); },
+ handleData: (v, s) { s.addError(v); },
+ handleError: (e, s) { s.add(e); },
handleDone: (s) {
s.add("foo");
@@ -119,8 +119,8 @@ testMultiController() {
actualEvents = new Events.capture(
c.stream.where((v) => v is String)
.map((v) => int.parse(v))
- .handleError((v) {
- if (v.error is! FormatException) throw v;
+ .handleError((error) {
+ if (error is! FormatException) throw error;
})
.where((v) => v > 10),
cancelOnError: true);
@@ -206,10 +206,10 @@ testSingleController() {
c = new StreamController();
expectedEvents = new Events()..add("ab")..error("[foo]");
sentEvents = new Events()..add("ab")..error("foo")..add("ab")..close();
- actualEvents = new Events.capture(c.stream.handleError((v) {
- if (v.error is String) {
- throw new AsyncError("[${v.error}]",
- "other stack");
+ actualEvents = new Events.capture(c.stream.handleError((error) {
+ if (error is String) {
+ // TODO(floitsch): this error originally changed the stack trace.
+ throw "[${error}]";
}
}), cancelOnError: true);
sentEvents.replay(c);
@@ -262,8 +262,8 @@ testSingleController() {
Future<bool> contains = c.stream.contains("b");
contains.then((var c) {
Expect.fail("no value expected");
- }).catchError((AsyncError e) {
- Expect.equals("FAIL", e.error);
+ }).catchError((error) {
+ Expect.equals("FAIL", error);
});
sentEvents.replay(c);
}
@@ -275,8 +275,8 @@ testSingleController() {
new Events()..error("a")..add(42)..error("b")..add("foo")..close();
actualEvents = new Events.capture(c.stream.transform(
new StreamTransformer(
- handleData: (v, s) { s.addError(new AsyncError(v)); },
- handleError: (e, s) { s.add(e.error); },
+ handleData: (v, s) { s.addError(v); },
+ handleError: (e, s) { s.add(e); },
handleDone: (s) {
s.add("foo");
s.close();
@@ -296,8 +296,8 @@ testSingleController() {
actualEvents = new Events.capture(
c.stream.where((v) => v is String)
.map((v) => int.parse(v))
- .handleError((v) {
- if (v.error is! FormatException) throw v;
+ .handleError((error) {
+ if (error is! FormatException) throw error;
})
.where((v) => v > 10),
cancelOnError: true);
« no previous file with comments | « tests/lib/async/stream_controller_async_test.dart ('k') | tests/lib/async/stream_event_transform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698