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

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

Issue 12475010: Revert "Update the test runner to use the new dart:io API" again (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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_suite.dart ('k') | tools/testing/dart/vendored_pkg/args/src/usage.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/utils.dart
diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart
index dc7924691e63af8b96972a7aad98056d2e5a6b57..7c2bbf7ba1bd338e82079a5e9c4972974de508c7 100644
--- a/tools/testing/dart/utils.dart
+++ b/tools/testing/dart/utils.dart
@@ -8,7 +8,7 @@ import 'dart:io';
import 'dart:utf' as utf;
class DebugLogger {
- static IOSink _sink;
+ static OutputStream _stream;
/**
* If [path] was null, the DebugLogger will write messages to stdout.
@@ -16,14 +16,14 @@ class DebugLogger {
static init(Path path, {append: false}) {
if (path != null) {
var mode = append ? FileMode.APPEND : FileMode.WRITE;
- _sink = new File.fromPath(path).openWrite(mode: mode);
+ _stream = new File.fromPath(path).openOutputStream(mode);
}
}
static void close() {
- if (_sink != null) {
- _sink.close();
- _sink = null;
+ if (_stream != null) {
+ _stream.close();
+ _stream = null;
}
}
@@ -40,8 +40,9 @@ class DebugLogger {
}
static void _print(String msg) {
- if (_sink != null) {
- _sink.writeln(msg);
+ if (_stream != null) {
+ _stream.write(encodeUtf8(msg));
+ _stream.write([0x0a]);
} else {
print(msg);
}
« no previous file with comments | « tools/testing/dart/test_suite.dart ('k') | tools/testing/dart/vendored_pkg/args/src/usage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698