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

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

Issue 11028076: Fix timer tests: timer tests were not using expectAsync to wait for (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Mark some tests as flaky in FF Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/isolate/isolate.status » ('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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 int _actualCalls = 0; 312 int _actualCalls = 0;
313 int _testNum; 313 int _testNum;
314 TestCase _testCase; 314 TestCase _testCase;
315 Function _shouldCallBack; 315 Function _shouldCallBack;
316 Function _isDone; 316 Function _isDone;
317 static const _sentinel = const _Sentinel(); 317 static const _sentinel = const _Sentinel();
318 318
319 _init(Function callback, Function shouldCallBack, Function isDone, 319 _init(Function callback, Function shouldCallBack, Function isDone,
320 [expectedCalls = 0]) { 320 [expectedCalls = 0]) {
321 ensureInitialized(); 321 ensureInitialized();
322 if (!(_currentTest >= 0 &&
323 _currentTest < _tests.length &&
324 _tests[_currentTest] != null)) {
325 print("No valid test, did you forget to run your test inside a call "
326 "to test()?");
327 }
322 assert(_currentTest >= 0 && 328 assert(_currentTest >= 0 &&
323 _currentTest < _tests.length && 329 _currentTest < _tests.length &&
324 _tests[_currentTest] != null); 330 _tests[_currentTest] != null);
325 _callback = callback; 331 _callback = callback;
326 _shouldCallBack = shouldCallBack; 332 _shouldCallBack = shouldCallBack;
327 _isDone = isDone; 333 _isDone = isDone;
328 _expectedCalls = expectedCalls; 334 _expectedCalls = expectedCalls;
329 _testNum = _currentTest; 335 _testNum = _currentTest;
330 _testCase = _tests[_currentTest]; 336 _testCase = _tests[_currentTest];
331 if (expectedCalls > 0) { 337 if (expectedCalls > 0) {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 } 877 }
872 878
873 /** Enable a test by ID. */ 879 /** Enable a test by ID. */
874 void enableTest(int testId) => _setTestEnabledState(testId, true); 880 void enableTest(int testId) => _setTestEnabledState(testId, true);
875 881
876 /** Disable a test by ID. */ 882 /** Disable a test by ID. */
877 void disableTest(int testId) => _setTestEnabledState(testId, false); 883 void disableTest(int testId) => _setTestEnabledState(testId, false);
878 884
879 /** Signature for a test function. */ 885 /** Signature for a test function. */
880 typedef void TestFunction(); 886 typedef void TestFunction();
OLDNEW
« no previous file with comments | « no previous file | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698