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

Side by Side Diff: pkg/unittest/lib/html_config.dart

Issue 18400002: Roll back "Use package:stack_trace in unittest." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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/unittest/lib/compact_vm_config.dart ('k') | pkg/unittest/lib/html_enhanced_config.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 /** 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 library unittest_html_config; 8 library unittest_html_config;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 var html = ''' 75 var html = '''
76 <tr> 76 <tr>
77 <td>${test_.id}</td> 77 <td>${test_.id}</td>
78 <td class="unittest-${test_.result}">${test_.result.toUpperCase()}</td> 78 <td class="unittest-${test_.result}">${test_.result.toUpperCase()}</td>
79 <td>Expectation: <a href="#testFilter=${test_.description}">${test_.desc ription}</a>. ${_htmlEscape(test_.message)}</td> 79 <td>Expectation: <a href="#testFilter=${test_.description}">${test_.desc ription}</a>. ${_htmlEscape(test_.message)}</td>
80 </tr>'''; 80 </tr>''';
81 81
82 if (test_.stackTrace != null) { 82 if (test_.stackTrace != null) {
83 html = '$html<tr><td></td><td colspan="2"><pre>' + 83 html = '$html<tr><td></td><td colspan="2"><pre>${_htmlEscape(test_.stackTrac e)}</pre></td></tr>';
84 _htmlEscape(test_.stackTrace.toString()) +
85 '</pre></td></tr>';
86 } 84 }
87 85
88 return html; 86 return html;
89 } 87 }
90 88
91 //TODO(pquitslund): Move to a common lib 89 //TODO(pquitslund): Move to a common lib
92 String _htmlEscape(String string) { 90 String _htmlEscape(String string) {
93 return string.replaceAll('&', '&amp;') 91 return string.replaceAll('&', '&amp;')
94 .replaceAll('<','&lt;') 92 .replaceAll('<','&lt;')
95 .replaceAll('>','&gt;'); 93 .replaceAll('>','&gt;');
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 window.postMessage('unittest-suite-done', '*'); 162 window.postMessage('unittest-suite-done', '*');
165 } 163 }
166 } 164 }
167 165
168 void useHtmlConfiguration([bool isLayoutTest = false]) { 166 void useHtmlConfiguration([bool isLayoutTest = false]) {
169 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; 167 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout;
170 } 168 }
171 169
172 final _singletonLayout = new HtmlConfiguration(true); 170 final _singletonLayout = new HtmlConfiguration(true);
173 final _singletonNotLayout = new HtmlConfiguration(false); 171 final _singletonNotLayout = new HtmlConfiguration(false);
OLDNEW
« no previous file with comments | « pkg/unittest/lib/compact_vm_config.dart ('k') | pkg/unittest/lib/html_enhanced_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698