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,11 @@ |
| bool _queuedToRun = false; |
| + /** |
| + * Whether test is currently being executed by [:runTest:]. |
|
Siggi Cherem (dart-lang)
2011/10/19 16:57:41
(3 minor nits):
- "Whether test..." => "Whether a
|
| + */ |
| + 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 +164,10 @@ |
| _uncaughtError = true; |
| } else if (_callbacksCalled == testCase.callbacks) { |
| testCase.recordSuccess(); |
| - _currentTest++; |
| - _nextBatch(); |
| + if (!_testIsRunning) { |
| + _currentTest++; |
| + _nextBatch(); |
| + } |
| } |
| } |
| @@ -189,6 +196,7 @@ |
| _uncaughtError = false; |
| _callbacksCalled = 0; |
| try { |
| + _testIsRunning = true; |
| (testCase.test)(); |
| if (!_uncaughtError) { |
| if (testCase.callbacks == _callbacksCalled) { |
| @@ -203,6 +211,8 @@ |
| if (!_uncaughtError) { |
| testCase.recordError('Caught ${e}', trace.toString()); |
| } |
| + } finally { |
| + _testIsRunning = false; |
| } |
| } |