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

Unified Diff: client/testing/unittest/unittestsuite.dart

Issue 8354006: Allow callbackDone while test is executed by runTest. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/testing/unittest/unittestsuite.dart
===================================================================
--- client/testing/unittest/unittestsuite.dart (revision 551)
+++ client/testing/unittest/unittestsuite.dart (working copy)
@@ -41,6 +41,9 @@
bool _queuedToRun = false;
+ /** Whether a test is currently being executed by [runTest]. */
+ bool _testIsRunning = false;
+
// TODO(sigmund): remove isLayoutTest argument after converting all DOM tests
// to use the named constructor below.
// TODO(vsm): remove the ignoredWindow parameter once all tests are fixed.
@@ -159,8 +162,10 @@
_uncaughtError = true;
} else if (_callbacksCalled == testCase.callbacks) {
testCase.recordSuccess();
Siggi Cherem (dart-lang) 2011/10/19 18:42:41 shouldn't this be inside the conditional too?
Anton Muhin 2011/10/19 18:51:58 I don't think so, but, please, double check: if te
Siggi Cherem (dart-lang) 2011/10/19 19:56:21 I think that might be covered in [runTests] also (
- _currentTest++;
- _nextBatch();
+ if (!_testIsRunning) {
+ _currentTest++;
+ _nextBatch();
+ }
}
}
@@ -189,6 +194,7 @@
_uncaughtError = false;
_callbacksCalled = 0;
try {
+ _testIsRunning = true;
(testCase.test)();
if (!_uncaughtError) {
if (testCase.callbacks == _callbacksCalled) {
@@ -203,6 +209,8 @@
if (!_uncaughtError) {
testCase.recordError('Caught ${e}', trace.toString());
}
+ } finally {
+ _testIsRunning = false;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698