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

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

Issue 20479002: TBR Fix build break by not using int for time. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 * ## Installing ## 8 * ## Installing ##
9 * 9 *
10 * Use [pub][] to install this package. Add the following to your `pubspec.yaml` 10 * Use [pub][] to install this package. Add the following to your `pubspec.yaml`
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 (_currentTestCaseIndex >= 0 && _currentTestCaseIndex < testCases.length) 293 (_currentTestCaseIndex >= 0 && _currentTestCaseIndex < testCases.length)
294 ? testCases[_currentTestCaseIndex] 294 ? testCases[_currentTestCaseIndex]
295 : null; 295 : null;
296 296
297 /** Whether the framework is in an initialized state. */ 297 /** Whether the framework is in an initialized state. */
298 bool _initialized = false; 298 bool _initialized = false;
299 299
300 String _uncaughtErrorMessage = null; 300 String _uncaughtErrorMessage = null;
301 301
302 /** Time since we last gave non-sync code a chance to be scheduled. */ 302 /** Time since we last gave non-sync code a chance to be scheduled. */
303 int _lastBreath = new DateTime.now().millisecondsSinceEpoch; 303 var _lastBreath = new DateTime.now().millisecondsSinceEpoch;
304 304
305 /** Test case result strings. */ 305 /** Test case result strings. */
306 // TODO(gram) we should change these constants to use a different string 306 // TODO(gram) we should change these constants to use a different string
307 // (so that writing 'FAIL' in the middle of a test doesn't 307 // (so that writing 'FAIL' in the middle of a test doesn't
308 // imply that the test fails). We can't do it without also changing 308 // imply that the test fails). We can't do it without also changing
309 // the testrunner and test.dart though. 309 // the testrunner and test.dart though.
310 const PASS = 'pass'; 310 const PASS = 'pass';
311 const FAIL = 'fail'; 311 const FAIL = 'fail';
312 const ERROR = 'error'; 312 const ERROR = 'error';
313 313
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 865
866 if (!formatStacks) return trace; 866 if (!formatStacks) return trace;
867 867
868 // Format the stack trace by removing everything above TestCase._runTest, 868 // Format the stack trace by removing everything above TestCase._runTest,
869 // which is usually going to be irrelevant. Also fold together unittest and 869 // which is usually going to be irrelevant. Also fold together unittest and
870 // core library calls so only the function the user called is visible. 870 // core library calls so only the function the user called is visible.
871 return new Trace(trace.frames.takeWhile((frame) { 871 return new Trace(trace.frames.takeWhile((frame) {
872 return frame.package != 'unittest' || frame.member != 'TestCase._runTest'; 872 return frame.package != 'unittest' || frame.member != 'TestCase._runTest';
873 })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore); 873 })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore);
874 } 874 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698