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

Side by Side Diff: utils/testrunner/pipeline_utils.dart

Issue 22872012: Remove Encoding-enum from dart:io and add interface in dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 7 years, 3 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 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 pipeline; 5 part of pipeline;
6 6
7 List log; 7 List log;
8 var replyPort; 8 var replyPort;
9 int _procId = 1; 9 int _procId = 1;
10 Map _procs = {}; 10 Map _procs = {};
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 stderr.add("Error starting process:"); 94 stderr.add("Error starting process:");
95 stderr.add(" Command: $command"); 95 stderr.add(" Command: $command");
96 stderr.add(" Error: ${e.toString()}"); 96 stderr.add(" Error: ${e.toString()}");
97 return new Future.value(-1); 97 return new Future.value(-1);
98 }); 98 });
99 } 99 }
100 100
101 Future _pipeStream(Stream stream, List<String> destination, 101 Future _pipeStream(Stream stream, List<String> destination,
102 Function outputMonitor) { 102 Function outputMonitor) {
103 return stream 103 return stream
104 .transform(new StringDecoder()) 104 .transform(UTF8.decoder)
105 .transform(new LineTransformer()) 105 .transform(new LineTransformer())
106 .listen((String line) { 106 .listen((String line) {
107 if (config["immediate"] && line.startsWith('###')) { 107 if (config["immediate"] && line.startsWith('###')) {
108 print(line.substring(3)); 108 print(line.substring(3));
109 } 109 }
110 if (outputMonitor != null) { 110 if (outputMonitor != null) {
111 outputMonitor(line); 111 outputMonitor(line);
112 } 112 }
113 destination.add(line); 113 destination.add(line);
114 }) 114 })
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 void completePipeline(List stdout, List stderr, [exitCode = 0]) { 204 void completePipeline(List stdout, List stderr, [exitCode = 0]) {
205 replyPort.send([stdout, stderr, log, exitCode]); 205 replyPort.send([stdout, stderr, log, exitCode]);
206 } 206 }
207 207
208 /** Utility function to log diagnostic messages. */ 208 /** Utility function to log diagnostic messages. */
209 void logMessage(msg) => log.add(msg); 209 void logMessage(msg) => log.add(msg);
210 210
211 /** Turn file paths into standard form with forward slashes. */ 211 /** Turn file paths into standard form with forward slashes. */
212 String normalizePath(String p) => (new Path(p)).toString(); 212 String normalizePath(String p) => (new Path(p)).toString();
OLDNEW
« no previous file with comments | « utils/testrunner/layout_test_controller.dart ('k') | utils/tests/testrunner/http_client_tests/http_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698