| 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 /// A simple unit test library for running tests in a browser. | 5 /// A simple unit test library for running tests in a browser. |
| 6 /// | 6 /// |
| 7 /// Provides enhanced HTML output with collapsible group headers | 7 /// Provides enhanced HTML output with collapsible group headers |
| 8 /// and other at-a-glance information about the test results. | 8 /// and other at-a-glance information about the test results. |
| 9 library unittest.html_enhanced_config; | 9 library unittest.html_enhanced_config; |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // handle the click event for the collapse all button | 132 // handle the click event for the collapse all button |
| 133 te.querySelector('#btnCollapseAll').onClick.listen((_) { | 133 te.querySelector('#btnCollapseAll').onClick.listen((_) { |
| 134 document | 134 document |
| 135 .querySelectorAll('.unittest-row') | 135 .querySelectorAll('.unittest-row') |
| 136 .forEach((el) => el.attributes['class'] = el.attributes['class'] | 136 .forEach((el) => el.attributes['class'] = el.attributes['class'] |
| 137 .replaceAll('unittest-row ', 'unittest-row-hidden ')); | 137 .replaceAll('unittest-row ', 'unittest-row-hidden ')); |
| 138 }); | 138 }); |
| 139 | 139 |
| 140 var previousGroup = ''; | 140 var previousGroup = ''; |
| 141 var groupPassFail = true; | 141 var groupPassFail = true; |
| 142 final indentAmount = 50; | |
| 143 | 142 |
| 144 // order by group and sort numerically within each group | 143 // order by group and sort numerically within each group |
| 145 var groupedBy = new LinkedHashMap<String, List<TestCase>>(); | 144 var groupedBy = new LinkedHashMap<String, List<TestCase>>(); |
| 146 | 145 |
| 147 for (final t in results) { | 146 for (final t in results) { |
| 148 if (!groupedBy.containsKey(t.currentGroup)) { | 147 if (!groupedBy.containsKey(t.currentGroup)) { |
| 149 groupedBy[t.currentGroup] = new List<TestCase>(); | 148 groupedBy[t.currentGroup] = new List<TestCase>(); |
| 150 } | 149 } |
| 151 | 150 |
| 152 groupedBy[t.currentGroup].add(t); | 151 groupedBy[t.currentGroup].add(t); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 396 |
| 398 '''; | 397 '''; |
| 399 } | 398 } |
| 400 | 399 |
| 401 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 400 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
| 402 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; | 401 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; |
| 403 } | 402 } |
| 404 | 403 |
| 405 final _singletonLayout = new HtmlEnhancedConfiguration(true); | 404 final _singletonLayout = new HtmlEnhancedConfiguration(true); |
| 406 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); | 405 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); |
| OLD | NEW |