OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * A library for writing dart unit tests. | 6 * A library for writing dart unit tests. |
7 * | 7 * |
8 * To import this library, specify the relative path to | 8 * To import this library, specify the relative path to |
9 * pkg/unittest/unittest.dart. | 9 * pkg/unittest/unittest.dart. |
10 * | 10 * |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 * [done] or if it fails with an exception. | 781 * [done] or if it fails with an exception. |
782 */ | 782 */ |
783 _nextBatch() { | 783 _nextBatch() { |
784 while (_currentTest < _tests.length) { | 784 while (_currentTest < _tests.length) { |
785 final testCase = _tests[_currentTest]; | 785 final testCase = _tests[_currentTest]; |
786 guardAsync(() { | 786 guardAsync(() { |
787 testCase.run(); | 787 testCase.run(); |
788 if (!testCase.isComplete && testCase.callbackFunctionsOutstanding == 0) { | 788 if (!testCase.isComplete && testCase.callbackFunctionsOutstanding == 0) { |
789 testCase.pass(); | 789 testCase.pass(); |
790 } | 790 } |
791 }, testNum:_currentTest); | 791 }, null, _currentTest); |
792 | 792 |
793 if (!testCase.isComplete && | 793 if (!testCase.isComplete && |
794 testCase.callbackFunctionsOutstanding > 0) return; | 794 testCase.callbackFunctionsOutstanding > 0) return; |
795 _currentTest++; | 795 _currentTest++; |
796 } | 796 } |
797 | 797 |
798 _completeTests(); | 798 _completeTests(); |
799 } | 799 } |
800 | 800 |
801 /** Publish results on the page and notify controller. */ | 801 /** Publish results on the page and notify controller. */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 } | 877 } |
878 | 878 |
879 /** Enable a test by ID. */ | 879 /** Enable a test by ID. */ |
880 void enableTest(int testId) => _setTestEnabledState(testId, true); | 880 void enableTest(int testId) => _setTestEnabledState(testId, true); |
881 | 881 |
882 /** Disable a test by ID. */ | 882 /** Disable a test by ID. */ |
883 void disableTest(int testId) => _setTestEnabledState(testId, false); | 883 void disableTest(int testId) => _setTestEnabledState(testId, false); |
884 | 884 |
885 /** Signature for a test function. */ | 885 /** Signature for a test function. */ |
886 typedef void TestFunction(); | 886 typedef void TestFunction(); |
OLD | NEW |