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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/serialization/test/serialization_test.dart ('k') | pkg/unittest/lib/matcher.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 /** 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 for (final test_ in flattened) { 165 for (final test_ in flattened) {
166 166
167 // replace everything but numbers and letters from the group name with 167 // replace everything but numbers and letters from the group name with
168 // '_' so we can use in id and class properties. 168 // '_' so we can use in id and class properties.
169 var safeGroup = test_.currentGroup.replaceAll(nonAlphanumeric,'_'); 169 var safeGroup = test_.currentGroup.replaceAll(nonAlphanumeric,'_');
170 170
171 if (test_.currentGroup != previousGroup){ 171 if (test_.currentGroup != previousGroup){
172 172
173 previousGroup = test_.currentGroup; 173 previousGroup = test_.currentGroup;
174 174
175 var testsInGroup = results.filter( 175 var testsInGroup = results
176 (TestCase t) => t.currentGroup == previousGroup); 176 .where((TestCase t) => t.currentGroup == previousGroup)
177 .toList();
177 var groupTotalTestCount = testsInGroup.length; 178 var groupTotalTestCount = testsInGroup.length;
178 var groupTestPassedCount = testsInGroup.filter( 179 var groupTestPassedCount = testsInGroup.where(
179 (TestCase t) => t.result == 'pass').length; 180 (TestCase t) => t.result == 'pass').length;
180 groupPassFail = groupTotalTestCount == groupTestPassedCount; 181 groupPassFail = groupTotalTestCount == groupTestPassedCount;
181 var passFailClass = "unittest-group-status unittest-group-" 182 var passFailClass = "unittest-group-status unittest-group-"
182 "status-${groupPassFail ? 'pass' : 'fail'}"; 183 "status-${groupPassFail ? 'pass' : 'fail'}";
183 184
184 te.elements.add(new Element.html(""" 185 te.elements.add(new Element.html("""
185 <div> 186 <div>
186 <div id='${safeGroup}' 187 <div id='${safeGroup}'
187 class='unittest-group ${safeGroup} test${safeGroup}'> 188 class='unittest-group ${safeGroup} test${safeGroup}'>
188 <div ${_isIE ? "style='display:inline-block' ": ""} 189 <div ${_isIE ? "style='display:inline-block' ": ""}
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 .unittest-row-description 406 .unittest-row-description
406 { 407 {
407 } 408 }
408 409
409 '''; 410 ''';
410 } 411 }
411 412
412 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { 413 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) {
413 configure(new HtmlEnhancedConfiguration(isLayoutTest)); 414 configure(new HtmlEnhancedConfiguration(isLayoutTest));
414 } 415 }
OLDNEW
« no previous file with comments | « pkg/serialization/test/serialization_test.dart ('k') | pkg/unittest/lib/matcher.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698