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

Unified Diff: tools/testing/dart/test_runner.dart

Issue 11883033: Fixed utf8 encoding/decoding issues in the testing scripts (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 20c10ac36c509609fcdebb710fb78e7f665bdc33..70edc804cc6702d37be9de8602e7e10f62dbf32c 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -17,10 +17,11 @@ import "dart:async";
import "dart:io" as io;
import "dart:isolate";
import "dart:uri";
+import "http_server.dart" as http_server;
import "status_file_parser.dart";
import "test_progress.dart";
import "test_suite.dart";
-import "http_server.dart" as http_server;
+import "utils.dart";
const int NO_TIMEOUT = 0;
const int SLOW_TIMEOUT_MULTIPLIER = 4;
@@ -625,7 +626,7 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
// and the virtual framebuffer X server didn't hook up, or DRT crashed with
// a core dump. Sometimes DRT crashes after it has set the stdout to PASS,
// so we have to do this check first.
- var stderrLines = new String.fromCharCodes(super.stderr).split("\n");
+ var stderrLines = decodeUtf8(super.stderr).split("\n");
for (String line in stderrLines) {
// TODO(kustermann,ricow): Issue: 7564
// This seems to happen quite frequently, we need to figure out why.
@@ -700,7 +701,7 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
// Browser tests fail unless stdout contains
// 'Content-Type: text/plain' followed by 'PASS'.
bool has_content_type = false;
- var stdoutLines = new String.fromCharCodes(super.stdout).split("\n");
+ var stdoutLines = decodeUtf8(super.stdout).split("\n");
for (String line in stdoutLines) {
switch (line) {
case 'Content-Type: text/plain':
@@ -773,7 +774,7 @@ class AnalysisCommandOutputImpl extends CommandOutputImpl {
List<String> staticWarnings = [];
// Read the returned list of errors and stuff them away.
- var stderrLines = new String.fromCharCodes(super.stderr).split("\n");
+ var stderrLines = decodeUtf8(super.stderr).split("\n");
for (String line in stderrLines) {
if (line.length == 0) continue;
List<String> fields = splitMachineError(line);
@@ -949,9 +950,9 @@ class RunningProcess {
&& testCase.configuration['verbose']) {
print(testCase.displayName);
- print(new String.fromCharCodes(lastCommandOutput.stderr));
+ print(decodeUtf8(lastCommandOutput.stderr));
if (!lastCommandOutput.command.isPixelTest) {
- print(new String.fromCharCodes(lastCommandOutput.stdout));
+ print(decodeUtf8(lastCommandOutput.stdout));
} else {
print("DRT pixel test failed! stdout is not printed because it "
"contains binary data!");
@@ -1319,7 +1320,8 @@ class BatchRunnerProcess {
} else if (line.startsWith('>>> ')) {
throw new Exception('Unexpected command from dartc batch runner.');
} else {
- buffer.addAll("$line\n".charCodes);
+ buffer.addAll(decodeUtf8(line));
+ buffer.addAll("\n".charCodes);
}
line = stream.readLine();
}
@@ -1346,7 +1348,8 @@ class BatchRunnerProcess {
if (line.startsWith('>>> EOF STDERR')) {
_stderrDone();
} else {
- buffer.addAll("$line\n".charCodes);
+ buffer.addAll(decodeUtf8(line));
+ buffer.addAll("\n".charCodes);
}
line = stream.readLine();
}
« no previous file with comments | « tools/testing/dart/test_progress.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698