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

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

Issue 11301046: Restructure pkg/unittest and pkg/webdriver to follow the pub conventions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of unittest_html_config;
6
5 /** This file is sourced by both dom_config.dart and html_config.dart. */ 7 /** This file is sourced by both dom_config.dart and html_config.dart. */
Siggi Cherem (dart-lang) 2012/10/31 20:54:02 move this comment above the 'part' declaration. co
gram 2012/11/01 21:23:19 Done.
6 8
7 /** Creates a table showing tests results in HTML. */ 9 /** Creates a table showing tests results in HTML. */
8 void _showResultsInPage(int passed, int failed, int errors, 10 void _showResultsInPage(int passed, int failed, int errors,
9 List<TestCase> results, bool isLayoutTest, String uncaughtError) { 11 List<TestCase> results, bool isLayoutTest, String uncaughtError) {
10 if (isLayoutTest && (passed == results.length) && uncaughtError == null) { 12 if (isLayoutTest && (passed == results.length) && uncaughtError == null) {
11 document.body.innerHTML = "PASS"; 13 document.body.innerHTML = "PASS";
12 } else { 14 } else {
13 var newBody = new StringBuffer(); 15 var newBody = new StringBuffer();
14 newBody.add("<table class='unittest-table'><tbody>"); 16 newBody.add("<table class='unittest-table'><tbody>");
15 newBody.add(passed == results.length && uncaughtError == null 17 newBody.add(passed == results.length && uncaughtError == null
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 72
71 return html; 73 return html;
72 } 74 }
73 75
74 //TODO(pquitslund): Move to a common lib 76 //TODO(pquitslund): Move to a common lib
75 String _htmlEscape(String string) { 77 String _htmlEscape(String string) {
76 return string.replaceAll('&', '&amp;') 78 return string.replaceAll('&', '&amp;')
77 .replaceAll('<','&lt;') 79 .replaceAll('<','&lt;')
78 .replaceAll('>','&gt;'); 80 .replaceAll('>','&gt;');
79 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698