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

Unified Diff: pkg/unittest/lib/html_config.dart

Issue 12316072: Some fixes in unittest after io v2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: also include htmlconfig Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: pkg/unittest/lib/html_config.dart
diff --git a/pkg/unittest/lib/html_config.dart b/pkg/unittest/lib/html_config.dart
index d4c9cdba48bf5652b859204ade1c5356bdbd26c2..9c64b535851fd7e962cc397cab82fe9b6fe2806e 100644
--- a/pkg/unittest/lib/html_config.dart
+++ b/pkg/unittest/lib/html_config.dart
@@ -18,17 +18,17 @@ void _showResultsInPage(int passed, int failed, int errors,
document.body.innerHtml = "PASS";
} else {
var newBody = new StringBuffer();
- newBody.add("<table class='unittest-table'><tbody>");
- newBody.add(passed == results.length && uncaughtError == null
+ newBody.write("<table class='unittest-table'><tbody>");
+ newBody.write(passed == results.length && uncaughtError == null
? "<tr><td colspan='3' class='unittest-pass'>PASS</td></tr>"
: "<tr><td colspan='3' class='unittest-fail'>FAIL</td></tr>");
for (final test_ in results) {
- newBody.add(_toHtml(test_));
+ newBody.write(_toHtml(test_));
}
if (uncaughtError != null) {
- newBody.add('''<tr>
+ newBody.write('''<tr>
<td>--</td>
<td class="unittest-error">ERROR</td>
<td>Uncaught error: $uncaughtError</td>
@@ -36,12 +36,12 @@ void _showResultsInPage(int passed, int failed, int errors,
}
if (passed == results.length && uncaughtError == null) {
- newBody.add("""
+ newBody.write("""
<tr><td colspan='3' class='unittest-pass'>
All ${passed} tests passed
</td></tr>""");
} else {
- newBody.add("""
+ newBody.write("""
<tr><td colspan='3'>Total
<span class='unittest-pass'>${passed} passed</span>,
<span class='unittest-fail'>${failed} failed</span>
@@ -49,7 +49,7 @@ void _showResultsInPage(int passed, int failed, int errors,
${errors + (uncaughtError == null ? 0 : 1)} errors</span>
</td></tr>""");
}
- newBody.add("</tbody></table>");
+ newBody.write("</tbody></table>");
document.body.innerHtml = newBody.toString();
}
}

Powered by Google App Engine
This is Rietveld 408576698