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

Unified Diff: pkg/unittest/lib/unittest.dart

Issue 12393017: Fix issue with async callbacks that get called synchronously while running test case function causi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/unittest/lib/src/test_case.dart ('k') | pkg/unittest/test/unittest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
===================================================================
--- pkg/unittest/lib/unittest.dart (revision 19336)
+++ pkg/unittest/lib/unittest.dart (working copy)
@@ -362,8 +362,9 @@
// if it previously passed.
if (testCase.result == PASS) {
testCase.error(
- 'Callback ${id}called after test case ${testCase.description} '
- 'has already been marked as done.', '');
+ 'Callback ${id}called ($actualCalls) after test case '
+ '${testCase.description} has already been marked as '
+ '${testCase.result}.', '');
}
return false;
} else if (maxExpectedCalls >= 0 && actualCalls > maxExpectedCalls) {
@@ -381,10 +382,7 @@
// Mark this callback as complete and remove it from the testcase
// oustanding callback count; if that hits zero the testcase is done.
complete = true;
- if (--testCase.callbackFunctionsOutstanding == 0 &&
- !testCase.isComplete) {
- testCase.pass();
- }
+ testCase.markCallbackComplete();
}
}
@@ -811,7 +809,7 @@
}
_initialized = true;
// Hook our async guard into the matcher library.
- wrapAsync = expectAsync1;
+ wrapAsync = (f, [id]) => expectAsync1(f, id: id);
_tests = <TestCase>[];
_testRunner = _nextBatch;
« no previous file with comments | « pkg/unittest/lib/src/test_case.dart ('k') | pkg/unittest/test/unittest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698