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

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

Issue 23926011: Rewrite Futures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad asserts. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/async/future_test.dart ('k') | tests/lib/async/future_value_chain3_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/future_value_chain2_test.dart
diff --git a/tests/lib/async/run_zoned5_test.dart b/tests/lib/async/future_value_chain2_test.dart
similarity index 52%
copy from tests/lib/async/run_zoned5_test.dart
copy to tests/lib/async/future_value_chain2_test.dart
index 6106a06295ea2686f8f4dc4c3cccc0b43c68befd..3b31c3df3b32ce03410a96a4fb3976a9de3d5c28 100644
--- a/tests/lib/async/run_zoned5_test.dart
+++ b/tests/lib/async/future_value_chain2_test.dart
@@ -6,12 +6,15 @@ import 'package:async_helper/async_helper.dart';
import "package:expect/expect.dart";
import 'dart:async';
+
main() {
asyncStart();
- // Ensure that `runZoned`'s onError handles synchronous errors.
- runZonedExperimental(() { throw 0; },
- onError: (e) {
- Expect.equals(0, e);
- asyncEnd();
- });
+ var errorFuture = new Future.error(499);
+ var valueChainFuture = new Future.sync(() => errorFuture);
+ // The errorFuture must not be propagated immediately as we would otherwise
+ // not have time to catch the error.
+ valueChainFuture.catchError((error) {
+ Expect.equals(499, error);
+ asyncEnd();
+ });
}
« no previous file with comments | « tests/lib/async/future_test.dart ('k') | tests/lib/async/future_value_chain3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698