OLD | NEW |
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 /** | 5 /** |
6 * A simple unit test library for running tests in a browser. | 6 * A simple unit test library for running tests in a browser. |
7 * | 7 * |
8 * Provides enhanced HTML output with collapsible group headers | 8 * Provides enhanced HTML output with collapsible group headers |
9 * and other at-a-glance information about the test results. | 9 * and other at-a-glance information about the test results. |
10 */ | 10 */ |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 if (!test_.isComplete) { | 264 if (!test_.isComplete) { |
265 addRowElement('${test_.id}', 'NO STATUS', 'Test did not complete.'); | 265 addRowElement('${test_.id}', 'NO STATUS', 'Test did not complete.'); |
266 return; | 266 return; |
267 } | 267 } |
268 | 268 |
269 addRowElement('${test_.id}', '${test_.result.toUpperCase()}', | 269 addRowElement('${test_.id}', '${test_.result.toUpperCase()}', |
270 '${test_.description}. ${_htmlEscape(test_.message)}'); | 270 '${test_.description}. ${_htmlEscape(test_.message)}'); |
271 | 271 |
272 if (test_.stackTrace != null) { | 272 if (test_.stackTrace != null) { |
273 addRowElement('', '', '<pre>${_htmlEscape(test_.stackTrace)}</pre>'); | 273 addRowElement('', '', |
| 274 '<pre>${_htmlEscape(test_.stackTrace.toString())}</pre>'); |
274 } | 275 } |
275 } | 276 } |
276 | 277 |
277 | 278 |
278 static bool get _isIE => window.navigator.userAgent.contains('MSIE'); | 279 static bool get _isIE => window.navigator.userAgent.contains('MSIE'); |
279 | 280 |
280 String get _htmlTestCSS => | 281 String get _htmlTestCSS => |
281 ''' | 282 ''' |
282 body{ | 283 body{ |
283 font-size: 14px; | 284 font-size: 14px; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 417 |
417 '''; | 418 '''; |
418 } | 419 } |
419 | 420 |
420 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 421 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
421 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; | 422 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; |
422 } | 423 } |
423 | 424 |
424 final _singletonLayout = new HtmlEnhancedConfiguration(true); | 425 final _singletonLayout = new HtmlEnhancedConfiguration(true); |
425 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); | 426 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); |
OLD | NEW |