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

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

Issue 11301046: Restructure pkg/unittest and pkg/webdriver to follow the pub conventions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/string_matchers.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) 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 _doneTeardown = true; 98 _doneTeardown = true;
99 } 99 }
100 _config.onTestResult(this); 100 _config.onTestResult(this);
101 } 101 }
102 102
103 void pass() { 103 void pass() {
104 result = PASS; 104 result = PASS;
105 _complete(); 105 _complete();
106 } 106 }
107 107
108 void fail(String messageText, String stack) { 108 void fail(String messageText, [String stack = '']) {
109 if (result != null) { 109 if (result != null) {
110 if (result == PASS) { 110 if (result == PASS) {
111 error('Test failed after initially passing: $messageText', stack); 111 error('Test failed after initially passing: $messageText', stack);
112 } else if (result == FAIL) { 112 } else if (result == FAIL) {
113 error('Test failed more than once: $messageText', stack); 113 error('Test failed more than once: $messageText', stack);
114 } 114 }
115 } else { 115 } else {
116 result = FAIL; 116 result = FAIL;
117 message = messageText; 117 message = messageText;
118 stackTrace = stack; 118 stackTrace = stack;
119 _complete(); 119 _complete();
120 } 120 }
121 } 121 }
122 122
123 void error(String messageText, String stack) { 123 void error(String messageText, [String stack = '']) {
124 result = ERROR; 124 result = ERROR;
125 message = messageText; 125 message = messageText;
126 stackTrace = stack; 126 stackTrace = stack;
127 _complete(); 127 _complete();
128 } 128 }
129 } 129 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/string_matchers.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698