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

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

Issue 11312203: "Reverting 14829-14832" (Closed) Base URL: https://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/interactive_html_config.dart ('k') | pkg/webdriver/lib/webdriver.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 part of unittest; 5 part of unittest;
6 6
7 /** 7 /**
8 * Hooks to configure the unittest library for different platforms. This class 8 * Hooks to configure the unittest library for different platforms. This class
9 * implements the API in a platform-independent way. Tests that want to take 9 * implements the API in a platform-independent way. Tests that want to take
10 * advantage of the platform can create a subclass and override methods from 10 * advantage of the platform can create a subclass and override methods from
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 if (success) { 127 if (success) {
128 _postMessage('unittest-suite-success'); 128 _postMessage('unittest-suite-success');
129 } else { 129 } else {
130 throw new Exception('Some tests failed.'); 130 throw new Exception('Some tests failed.');
131 } 131 }
132 } 132 }
133 133
134 String _indent(String str) { 134 String _indent(String str) {
135 // TODO(nweiz): Use this simpler code once issue 2980 is fixed. 135 // TODO(nweiz): Use this simpler code once issue 2980 is fixed.
136 // return str.replaceAll(new RegExp("^", multiLine: true), " "); 136 // return str.replaceAll(const RegExp("^", multiLine: true), " ");
137 137
138 return Strings.join(str.split("\n").map((line) => " $line"), "\n"); 138 return Strings.join(str.split("\n").map((line) => " $line"), "\n");
139 } 139 }
140 140
141 /** Handle errors that happen outside the tests. */ 141 /** Handle errors that happen outside the tests. */
142 // TODO(vsm): figure out how to expose the stack trace here 142 // TODO(vsm): figure out how to expose the stack trace here
143 // Currently e.message works in dartium, but not in dartc. 143 // Currently e.message works in dartium, but not in dartc.
144 handleExternalError(e, String message) => 144 handleExternalError(e, String message) =>
145 _reportTestError('$message\nCaught $e', ''); 145 _reportTestError('$message\nCaught $e', '');
146 146
147 _postMessage(String message) { 147 _postMessage(String message) {
148 // In dart2js browser tests, the JavaScript-based test controller 148 // In dart2js browser tests, the JavaScript-based test controller
149 // intercepts calls to print and listens for "secret" messages. 149 // intercepts calls to print and listens for "secret" messages.
150 print(message); 150 print(message);
151 } 151 }
152 } 152 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/interactive_html_config.dart ('k') | pkg/webdriver/lib/webdriver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698