Chromium Code Reviews| Index: client/testing/unittest/unittestsuite.dart |
| diff --git a/client/testing/unittest/unittestsuite.dart b/client/testing/unittest/unittestsuite.dart |
| index fde5b2e39d0fd06f4233c3851e1777caa0e841f1..3368d4655de2e05eeb347e1e2f1f5fd9f894e1e5 100644 |
| --- a/client/testing/unittest/unittestsuite.dart |
| +++ b/client/testing/unittest/unittestsuite.dart |
| @@ -305,6 +305,21 @@ void asyncTest(String spec, int callbacks, TestFunction body) { |
| } |
| } |
| +void serialInvokeAsync(List closures) { |
| + final length = closures.length; |
| + if (length > 0) { |
|
nweiz
2011/10/28 03:58:38
Style nit: if (length == 0) return;
Jacob
2011/10/31 22:09:50
For this case i think the code is slightly easier
|
| + int i = 0; |
| + void invokeNext() { |
| + closures[i](); |
| + i++; |
| + if (i < length) { |
| + window.setTimeout(invokeNext, 0); |
| + } |
| + } |
| + window.setTimeout(invokeNext, 0); |
| + } |
| +} |
| + |
| /** |
| * Creates a new named group of tests. Calls to group() or test() within the |
| * body of the function passed to this will inherit this group's description. |