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

Side by Side Diff: tests/standalone/io/stdin_sync_test.dart

Issue 46063010: Change dart:io Platform.script to return a Uri. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 1 month 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import "dart:convert"; 5 import "dart:convert";
6 import "dart:io"; 6 import "dart:io";
7 7
8 import "package:path/path.dart"; 8 import "package:path/path.dart";
9 9
10 void testReadByte() { 10 void testReadByte() {
11 void test(String line, List<String> expected) { 11 void test(String line, List<String> expected) {
12 var script = join(dirname(Platform.script), "stdin_sync_script.dart"); 12 var script = Platform.script.resolve("stdin_sync_script.dart").toFilePath();
13 Process.start(Platform.executable, 13 Process.start(Platform.executable,
14 ["--checked", script]..addAll( 14 ["--checked", script]..addAll(
15 expected.map(JSON.encode))).then((process) { 15 expected.map(JSON.encode))).then((process) {
16 process.stdin.write(line); 16 process.stdin.write(line);
17 process.stdin.close(); 17 process.stdin.close();
18 process.stderr 18 process.stderr
19 .transform(UTF8.decoder) 19 .transform(UTF8.decoder)
20 .transform(new LineSplitter()) 20 .transform(new LineSplitter())
21 .fold(new StringBuffer(), (b, d) => b..write(d)) 21 .fold(new StringBuffer(), (b, d) => b..write(d))
22 .then((data) { 22 .then((data) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 62
63 void main() { 63 void main() {
64 testReadByte(); 64 testReadByte();
65 65
66 // testEchoMode and testLineMode is an developer-interactive test, thus not 66 // testEchoMode and testLineMode is an developer-interactive test, thus not
67 // enabled. 67 // enabled.
68 //testEchoMode(); 68 //testEchoMode();
69 //testLineMode(); 69 //testLineMode();
70 } 70 }
OLDNEW
« no previous file with comments | « tests/standalone/io/socket_upgrade_to_secure_test.dart ('k') | tests/standalone/io/test_extension_fail_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698