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

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

Issue 14092004: Chaining of setup/teardown. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/scheduled_test/test/scheduled_test/set_up_test.dart ('k') | pkg/unittest/lib/unittest.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 Duration _runningTime; 54 Duration _runningTime;
55 Duration get runningTime => _runningTime; 55 Duration get runningTime => _runningTime;
56 56
57 bool enabled = true; 57 bool enabled = true;
58 58
59 bool _doneTeardown = false; 59 bool _doneTeardown = false;
60 60
61 Completer _testComplete; 61 Completer _testComplete;
62 62
63 TestCase._internal(this.id, this.description, this.testFunction) 63 TestCase._internal(this.id, this.description, this.testFunction)
64 : currentGroup = _currentGroup, 64 : currentGroup = _currentContext.groupName,
65 setUp = _testSetup, 65 setUp = _currentContext.testSetup,
66 tearDown = _testTeardown; 66 tearDown = _currentContext.testTeardown;
67 67
68 bool get isComplete => !enabled || result != null; 68 bool get isComplete => !enabled || result != null;
69 69
70 void _prepTest() { 70 void _prepTest() {
71 _config.onTestStart(this); 71 _config.onTestStart(this);
72 _startTime = new DateTime.now(); 72 _startTime = new DateTime.now();
73 _runningTime = null; 73 _runningTime = null;
74 } 74 }
75 75
76 Future _runTest() { 76 Future _runTest() {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void error(String messageText, [String stack = '']) { 209 void error(String messageText, [String stack = '']) {
210 _complete(ERROR, messageText, stack); 210 _complete(ERROR, messageText, stack);
211 } 211 }
212 212
213 void _markCallbackComplete() { 213 void _markCallbackComplete() {
214 if (--_callbackFunctionsOutstanding == 0 && !isComplete) { 214 if (--_callbackFunctionsOutstanding == 0 && !isComplete) {
215 pass(); 215 pass();
216 } 216 }
217 } 217 }
218 } 218 }
OLDNEW
« no previous file with comments | « pkg/scheduled_test/test/scheduled_test/set_up_test.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698