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

Unified Diff: pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart

Issue 229453002: Support returning a Future from a setUp or test body in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « pkg/scheduled_test/test/scheduled_test/set_up_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart
diff --git a/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart b/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart
index 077aeb4473b1a462021e9e2dddf7a2fa02ba52ba..b6b5ca0169a85cf222262cf8abd8bbcc9e33ecfc 100644
--- a/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart
+++ b/pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart
@@ -44,6 +44,26 @@ void main(_, message) {
});
});
+ expectTestsPass("a returned future should be implicitly wrapped",
+ () {
+ test('test', () {
+ var futureComplete = false;
+ currentSchedule.onComplete.schedule(() => expect(futureComplete, isTrue));
+
+ return pumpEventQueue().then((_) => futureComplete = true);
+ });
+ });
+
+ expectTestsPass("a returned future should not block the schedule",
+ () {
+ test('test', () {
+ var futureComplete = false;
+ schedule(() => expect(futureComplete, isFalse));
+
+ return pumpEventQueue().then((_) => futureComplete = true);
+ });
+ });
+
expectTestsPass("wrapFuture should pass through the error of the wrapped "
"future", () {
var error;
« no previous file with comments | « pkg/scheduled_test/test/scheduled_test/set_up_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698