Chromium Code Reviews| Index: tests/html/utils.dart |
| diff --git a/tests/html/utils.dart b/tests/html/utils.dart |
| index 9be11b071bb437b136fc86b4dbbc0c7c69c23577..3734372395a9adb4ecd2f77dbc687e4e65ab60f1 100644 |
| --- a/tests/html/utils.dart |
| +++ b/tests/html/utils.dart |
| @@ -1,4 +1,5 @@ |
| library TestUtils; |
| +import 'dart:async'; |
| import '../../pkg/unittest/lib/unittest.dart'; |
| /** |
| @@ -68,3 +69,29 @@ verifyGraph(expected, actual) { |
| walk('', expected, actual); |
| } |
| + |
| +void futureTest(spec, Future body()) { |
| + test(spec, () { |
| + expect(body(), completes); |
| + }); |
| +} |
| + |
| +/** |
| + * Executes an array of test functions which return futures in parallel. |
| + * |
| + * This returns a future result of the last function. |
| + */ |
| +Future chainSteps(List<Function> steps) { |
| + var future = steps[0](); |
| + for (var step in steps.skip(1)) { |
| + future = future.then( |
| + (value) { |
| + var result; |
| + guardAsync(() { |
|
nweiz
2013/02/05 02:03:19
guardAsync shouldn't be necessary if you're using
blois
2013/02/05 03:02:42
The error messages that I get from exceptions thro
nweiz
2013/02/05 03:05:39
How so? What's different about it?
blois
2013/02/06 23:34:13
Resolution: issues unrelated to this code (unclose
|
| + result = step(value); |
| + }); |
| + return result; |
| + }); |
| + } |
| + return future; |
| +} |