Chromium Code Reviews

Side by Side Diff: pkg/unittest/lib/src/spread_args_helper.dart

Issue 133313004: pkg/unittest: Run tests in zones (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nit Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/lib/html_config.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 101 matching lines...)
112 112
113 invoke2(arg1, arg2) { 113 invoke2(arg1, arg2) {
114 return _guardAsync( 114 return _guardAsync(
115 () { 115 () {
116 if (shouldCallBack()) { 116 if (shouldCallBack()) {
117 return callback(arg1, arg2); 117 return callback(arg1, arg2);
118 } 118 }
119 }, 119 },
120 after, testCase); 120 after, testCase);
121 } 121 }
122
123 _guardAsync(Function tryBody, Function finallyBody, TestCase testCase) {
124 assert(testCase != null);
125 try {
126 return tryBody();
127 } catch (e, trace) {
128 _registerException(testCase, e, trace);
129 } finally {
130 if (finallyBody != null) finallyBody();
131 }
132 }
122 } 133 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/html_config.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine