Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 part of unittest; | 1 part of unittest; |
| 2 | 2 |
| 3 /** Simulates spread arguments using named arguments. */ | 3 /** Simulates spread arguments using named arguments. */ |
| 4 // TODO(sigmund): remove this class and simply use a closure with named | 4 // TODO(sigmund): remove this class and simply use a closure with named |
| 5 // arguments (if still applicable). | 5 // arguments (if still applicable). |
| 6 class _SpreadArgsHelper { | 6 class _SpreadArgsHelper { |
| 7 final Function callback; | 7 final Function callback; |
| 8 final int minExpectedCalls; | 8 final int minExpectedCalls; |
| 9 final int maxExpectedCalls; | 9 final int maxExpectedCalls; |
| 10 final Function isDone; | 10 final Function isDone; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 | 113 |
| 114 invoke2(arg1, arg2) { | 114 invoke2(arg1, arg2) { |
| 115 return _guardAsync( | 115 return _guardAsync( |
| 116 () { | 116 () { |
| 117 if (shouldCallBack()) { | 117 if (shouldCallBack()) { |
| 118 return callback(arg1, arg2); | 118 return callback(arg1, arg2); |
| 119 } | 119 } |
| 120 }, | 120 }, |
| 121 after, testCase); | 121 after, testCase); |
| 122 } | 122 } |
| 123 | |
| 124 _guardAsync(Function tryBody, Function finallyBody, TestCase testCase) { | |
|
Siggi Cherem (dart-lang)
2014/02/04 02:20:05
I thought we were going to get rid of this too (si
kevmoo
2014/02/04 02:26:18
This is still used by the expectAsync logic. I'm l
Siggi Cherem (dart-lang)
2014/02/04 02:42:01
I meant, I thought you were going to get rid of it
| |
| 125 assert(testCase != null); | |
| 126 try { | |
| 127 return tryBody(); | |
| 128 } catch (e, trace) { | |
| 129 _registerException(testCase, e, trace); | |
| 130 } finally { | |
| 131 if (finallyBody != null) finallyBody(); | |
| 132 } | |
| 133 } | |
| 123 } | 134 } |
| OLD | NEW |