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

Side by Side Diff: pkg/unittest/unittest.dart

Issue 10968040: Eliminate some of the flakiness in testing: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/test_controller.js ('k') | tools/testing/run_selenium.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 int _expectedCalls; 310 int _expectedCalls;
311 int _actualCalls = 0; 311 int _actualCalls = 0;
312 int _testNum; 312 int _testNum;
313 TestCase _testCase; 313 TestCase _testCase;
314 Function _shouldCallBack; 314 Function _shouldCallBack;
315 Function _isDone; 315 Function _isDone;
316 316
317 _init(Function callback, Function shouldCallBack, Function isDone, 317 _init(Function callback, Function shouldCallBack, Function isDone,
318 [expectedCalls = 0]) { 318 [expectedCalls = 0]) {
319 ensureInitialized(); 319 ensureInitialized();
320 assert(_currentTest < _tests.length); 320 assert(_currentTest >= 0 &&
321 _currentTest < _tests.length &&
322 _tests[_currentTest] != null);
321 _callback = callback; 323 _callback = callback;
322 _shouldCallBack = shouldCallBack; 324 _shouldCallBack = shouldCallBack;
323 _isDone = isDone; 325 _isDone = isDone;
324 _expectedCalls = expectedCalls; 326 _expectedCalls = expectedCalls;
325 _testNum = _currentTest; 327 _testNum = _currentTest;
326 _testCase = _tests[_currentTest]; 328 _testCase = _tests[_currentTest];
327 if (expectedCalls > 0) { 329 if (expectedCalls > 0) {
328 _testCase.callbackFunctionsOutstanding++; 330 _testCase.callbackFunctionsOutstanding++;
329 } 331 }
330 } 332 }
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 869 }
868 870
869 /** Enable a test by ID. */ 871 /** Enable a test by ID. */
870 void enableTest(int testId) => _setTestEnabledState(testId, true); 872 void enableTest(int testId) => _setTestEnabledState(testId, true);
871 873
872 /** Disable a test by ID. */ 874 /** Disable a test by ID. */
873 void disableTest(int testId) => _setTestEnabledState(testId, false); 875 void disableTest(int testId) => _setTestEnabledState(testId, false);
874 876
875 /** Signature for a test function. */ 877 /** Signature for a test function. */
876 typedef void TestFunction(); 878 typedef void TestFunction();
OLDNEW
« no previous file with comments | « pkg/unittest/test_controller.js ('k') | tools/testing/run_selenium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698