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('', '', | 273 addRowElement('', '', '<pre>${_htmlEscape(test_.stackTrace)}</pre>'); |
274 '<pre>${_htmlEscape(test_.stackTrace.toString())}</pre>'); | |
275 } | 274 } |
276 } | 275 } |
277 | 276 |
278 | 277 |
279 static bool get _isIE => window.navigator.userAgent.contains('MSIE'); | 278 static bool get _isIE => window.navigator.userAgent.contains('MSIE'); |
280 | 279 |
281 String get _htmlTestCSS => | 280 String get _htmlTestCSS => |
282 ''' | 281 ''' |
283 body{ | 282 body{ |
284 font-size: 14px; | 283 font-size: 14px; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 416 |
418 '''; | 417 '''; |
419 } | 418 } |
420 | 419 |
421 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 420 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
422 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; | 421 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; |
423 } | 422 } |
424 | 423 |
425 final _singletonLayout = new HtmlEnhancedConfiguration(true); | 424 final _singletonLayout = new HtmlEnhancedConfiguration(true); |
426 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); | 425 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); |
OLD | NEW |