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

Unified Diff: lib/unittest/unittest.dart

Issue 10382094: Refactor the pub tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename guard to guardAsync Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/unittest/config.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/unittest/unittest.dart
diff --git a/lib/unittest/unittest.dart b/lib/unittest/unittest.dart
index 769b05eabe633655a6e4e2c36601af3b280f5b15..a59a12c218eed25d0bc10fcc4e99693df54f9cb6 100644
--- a/lib/unittest/unittest.dart
+++ b/lib/unittest/unittest.dart
@@ -285,7 +285,7 @@ class _SpreadArgsHelper {
invoke([arg0 = _sentinel, arg1 = _sentinel, arg2 = _sentinel,
arg3 = _sentinel, arg4 = _sentinel]) {
- return _guard(() {
+ return guardAsync(() {
if (!_incrementCall()) {
return;
} else if (arg0 == _sentinel) {
@@ -308,19 +308,19 @@ class _SpreadArgsHelper {
}
invoke0() {
- return _guard(
+ return guardAsync(
() => _incrementCall() ? callback() : null,
() { if (calls == expectedCalls) callbackDone(); });
}
invoke1(arg1) {
- return _guard(
+ return guardAsync(
() => _incrementCall() ? callback(arg1) : null,
() { if (calls == expectedCalls) callbackDone(); });
}
invoke2(arg1, arg2) {
- return _guard(
+ return guardAsync(
() => _incrementCall() ? callback(arg1, arg2) : null,
() { if (calls == expectedCalls) callbackDone(); });
}
@@ -468,7 +468,7 @@ _runTests() {
* Run [tryBody] guarded in a try-catch block. If an exception is thrown, update
* the [_currentTest] status accordingly.
*/
-_guard(tryBody, [finallyBody]) {
+guardAsync(tryBody, [finallyBody]) {
try {
return tryBody();
} catch (ExpectException e, var trace) {
@@ -501,7 +501,7 @@ _guard(tryBody, [finallyBody]) {
_nextBatch() {
while (_currentTest < _tests.length) {
final testCase = _tests[_currentTest];
- _guard(() {
+ guardAsync(() {
_callbacksCalled = 0;
_state = _RUNNING_TEST;
« no previous file with comments | « lib/unittest/config.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698