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

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

Issue 2638023004: Remove recently added --checked flag from named_pipe_script_test to make it compatible with product… (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 // Testing file input stream, VM-only, standalone test. 4 // Testing file input stream, VM-only, standalone test.
5 5
6 import "dart:convert"; 6 import "dart:convert";
7 import "dart:io"; 7 import "dart:io";
8 8
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 13 matching lines...) Expand all
24 // If there's no file system access to the pipe, then we can't do a meaningful 24 // If there's no file system access to the pipe, then we can't do a meaningful
25 // test. 25 // test.
26 if (!await (new File(stdinPipePath).exists())) { 26 if (!await (new File(stdinPipePath).exists())) {
27 print("Couldn't find $stdinPipePath."); 27 print("Couldn't find $stdinPipePath.");
28 asyncEnd(); 28 asyncEnd();
29 return; 29 return;
30 } 30 }
31 31
32 StringBuffer output = new StringBuffer(); 32 StringBuffer output = new StringBuffer();
33 Process process = 33 Process process =
34 await Process.start(Platform.executable, ['--checked', stdinPipePath]); 34 await Process.start(Platform.executable, [stdinPipePath]);
35 bool stdinWriteFailed = false; 35 bool stdinWriteFailed = false;
36 process.stdout.transform(UTF8.decoder).listen(output.write); 36 process.stdout.transform(UTF8.decoder).listen(output.write);
37 process.stderr.transform(UTF8.decoder).listen((data) { 37 process.stderr.transform(UTF8.decoder).listen((data) {
38 if (!stdinWriteFailed) { 38 if (!stdinWriteFailed) {
39 Expect.fail(data); 39 Expect.fail(data);
40 process.kill(); 40 process.kill();
41 } 41 }
42 }); 42 });
43 process.stdin.done.catchError((e) { 43 process.stdin.done.catchError((e) {
44 // If the write to stdin fails, then give up. We can't test the thing we 44 // If the write to stdin fails, then give up. We can't test the thing we
45 // wanted to test. 45 // wanted to test.
46 stdinWriteFailed = true; 46 stdinWriteFailed = true;
47 process.kill(); 47 process.kill();
48 }); 48 });
49 process.stdin.writeln(script); 49 process.stdin.writeln(script);
50 process.stdin.close(); 50 process.stdin.close();
51 51
52 int status = await process.exitCode; 52 int status = await process.exitCode;
53 if (!stdinWriteFailed) { 53 if (!stdinWriteFailed) {
54 Expect.equals(0, status); 54 Expect.equals(0, status);
55 Expect.equals("Hello, World!\n", output.toString()); 55 Expect.equals("Hello, World!\n", output.toString());
56 } 56 }
57 asyncEnd(); 57 asyncEnd();
58 } 58 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698