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

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

Issue 145403005: pkg/unittest: formatter spin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review nits Created 6 years, 10 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/lib/src/numeric_matchers.dart ('k') | pkg/unittest/lib/src/utils.dart » ('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) 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 part of unittest; 5 part of unittest;
6 6
7 /** 7 /**
8 * Represents the state for an individual unit test. 8 * Represents the state for an individual unit test.
9 * 9 *
10 * Create by calling [test] or [solo_test]. 10 * Create by calling [test] or [solo_test].
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 Duration _runningTime; 57 Duration _runningTime;
58 Duration get runningTime => _runningTime; 58 Duration get runningTime => _runningTime;
59 59
60 bool enabled = true; 60 bool enabled = true;
61 61
62 bool _doneTeardown = false; 62 bool _doneTeardown = false;
63 63
64 Completer _testComplete; 64 Completer _testComplete;
65 65
66 TestCase._internal(this.id, this.description, this.testFunction) 66 TestCase._internal(this.id, this.description, this.testFunction)
67 : currentGroup = _currentContext.fullName, 67 : currentGroup = _currentContext.fullName,
68 setUp = _currentContext.testSetup, 68 setUp = _currentContext.testSetup,
69 tearDown = _currentContext.testTeardown; 69 tearDown = _currentContext.testTeardown;
70 70
71 bool get isComplete => !enabled || result != null; 71 bool get isComplete => !enabled || result != null;
72 72
73 Function _errorHandler(String stage) => (e, stack) { 73 Function _errorHandler(String stage) => (e, stack) {
74 if (stack == null && e is Error) { 74 if (stack == null && e is Error) {
75 stack = e.stackTrace; 75 stack = e.stackTrace;
76 } 76 }
77 if (result == null || result == PASS) { 77 if (result == null || result == PASS) {
78 if (e is TestFailure) { 78 if (e is TestFailure) {
79 fail("$e", stack); 79 fail("$e", stack);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 182
183 void _markCallbackComplete() { 183 void _markCallbackComplete() {
184 if (--_callbackFunctionsOutstanding == 0 && !isComplete) { 184 if (--_callbackFunctionsOutstanding == 0 && !isComplete) {
185 pass(); 185 pass();
186 } 186 }
187 } 187 }
188 188
189 String toString() => _result != null ? "$description: $result" : description; 189 String toString() => _result != null ? "$description: $result" : description;
190 } 190 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/numeric_matchers.dart ('k') | pkg/unittest/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698