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

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

Issue 10905255: Change Duration to take proper named optional parameters. (Closed) Base URL: https://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
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 * testcase.dart: this file is sourced by unittest.dart. It defines [TestCase] 6 * testcase.dart: this file is sourced by unittest.dart. It defines [TestCase]
7 * and assumes unittest defines the type [TestFunction]. 7 * and assumes unittest defines the type [TestFunction].
8 */ 8 */
9 9
10 /** Summarizes information about a single test case. */ 10 /** Summarizes information about a single test case. */
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 runningTime = null; 79 runningTime = null;
80 test(); 80 test();
81 } 81 }
82 } 82 }
83 83
84 void _complete() { 84 void _complete() {
85 if (runningTime == null) { 85 if (runningTime == null) {
86 // TODO(gram): currently the duration measurement code is blocked 86 // TODO(gram): currently the duration measurement code is blocked
87 // by issue 4437. When that is fixed replace the line below with: 87 // by issue 4437. When that is fixed replace the line below with:
88 // runningTime = new Date.now().difference(startTime); 88 // runningTime = new Date.now().difference(startTime);
89 runningTime = new Duration(milliseconds:0); 89 runningTime = new Duration(milliseconds: 0);
bakster 2012/09/13 09:00:01 How about introducing a static or a named construc
kasperl 2012/09/13 09:04:47 That's fine but that extra constructor will not ma
Lasse Reichstein Nielsen 2012/09/13 09:30:46 Not prevent it, but perhaps it will preempt it by
90 } 90 }
91 if (!_doneTeardown) { 91 if (!_doneTeardown) {
92 if (_tearDown != null) { 92 if (_tearDown != null) {
93 _tearDown(); 93 _tearDown();
94 } 94 }
95 _doneTeardown = true; 95 _doneTeardown = true;
96 } 96 }
97 _config.onTestResult(this); 97 _config.onTestResult(this);
98 } 98 }
99 99
(...skipping 17 matching lines...) Expand all
117 } 117 }
118 } 118 }
119 119
120 void error(String messageText, String stack) { 120 void error(String messageText, String stack) {
121 result = _ERROR; 121 result = _ERROR;
122 message = messageText; 122 message = messageText;
123 stackTrace = stack; 123 stackTrace = stack;
124 _complete(); 124 _complete();
125 } 125 }
126 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698