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

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

Issue 12417004: Update the test runner to use the new dart:io API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes 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
Index: tools/testing/dart/utils.dart
diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart
index 7c2bbf7ba1bd338e82079a5e9c4972974de508c7..dc7924691e63af8b96972a7aad98056d2e5a6b57 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 OutputStream _stream;
+ static IOSink _sink;
/**
* 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;
- _stream = new File.fromPath(path).openOutputStream(mode);
+ _sink = new File.fromPath(path).openWrite(mode: mode);
}
}
static void close() {
- if (_stream != null) {
- _stream.close();
- _stream = null;
+ if (_sink != null) {
+ _sink.close();
+ _sink = null;
}
}
@@ -40,9 +40,8 @@ class DebugLogger {
}
static void _print(String msg) {
- if (_stream != null) {
- _stream.write(encodeUtf8(msg));
- _stream.write([0x0a]);
+ if (_sink != null) {
+ _sink.writeln(msg);
} else {
print(msg);
}

Powered by Google App Engine
This is Rietveld 408576698