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

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

Issue 130173010: pkg/unittest: Run each test in a Zone (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: long line Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698