Chromium Code Reviews| 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; |
| } |
| } |