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

Side by Side Diff: tests/standalone/src/io/ProcessRunOutputTest.dart

Issue 10069053: Fix Process test, fix Process factory, diable tests on dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
« no previous file with comments | « runtime/bin/process_impl.dart ('k') | tests/standalone/standalone-leg.status » ('j') | 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) 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 // Test script for testing that output is handled correctly for 5 // Test script for testing that output is handled correctly for
6 // non-interactive processes started with Process.run. 6 // non-interactive processes started with Process.run.
7 7
8 #import("dart:io"); 8 #import("dart:io");
9 #source("ProcessTestUtil.dart"); 9 #source("ProcessTestUtil.dart");
10 10
11 checkOutput(encoding, output) { 11 checkOutput(encoding, output) {
12 if (encoding == 'ascii') { 12 if (encoding == 'ascii') {
13 Expect.equals(output, 'abc'); 13 Expect.equals(output, 'abc');
14 } else if (encoding == 'latin1') { 14 } else if (encoding == 'latin1') {
15 Expect.equals(output, 'æøå'); 15 Expect.equals(output, 'æøå');
16 } else if (encoding == 'utf8') { 16 } else if (encoding == 'utf8') {
17 Expect.listEquals(output.charCodes(), [955]); 17 Expect.listEquals(output.charCodes(), [955]);
18 } 18 }
19 } 19 }
20 20
21 test(scriptFile, encoding, stream) { 21 test(scriptFile, encoding, stream) {
22 var enc; 22 var enc;
23 if (encoding == 'ascii') { 23 if (encoding == 'ascii') {
24 enc = Encoding.ASCII; 24 enc = Encoding.ASCII;
25 } else if (encoding == 'latin1') { 25 } else if (encoding == 'latin1') {
26 enc = Encoding.ISO_8859_1; 26 enc = Encoding.ISO_8859_1;
27 } else if (encoding = 'utf8') { 27 } else if (encoding == 'utf8') {
28 enc = Encoding.UTF_8; 28 enc = Encoding.UTF_8;
29 } 29 }
30 30
31 var options = new ProcessOptions(); 31 var options = new ProcessOptions();
32 if (stream == 'stdout') { 32 if (stream == 'stdout') {
33 options.stdoutEncoding = enc; 33 options.stdoutEncoding = enc;
34 new Process.run(getDartFileName(), [scriptFile, encoding, stream], 34 new Process.run(getDartFileName(), [scriptFile, encoding, stream],
35 options, (exit, out, err) { 35 options, (exit, out, err) {
36 Expect.equals(exit, 0); 36 Expect.equals(exit, 0);
37 Expect.equals(err, ''); 37 Expect.equals(err, '');
(...skipping 18 matching lines...) Expand all
56 } 56 }
57 Expect.isTrue(scriptFile.existsSync()); 57 Expect.isTrue(scriptFile.existsSync());
58 test(scriptFile.name, 'ascii', 'stdout'); 58 test(scriptFile.name, 'ascii', 'stdout');
59 test(scriptFile.name, 'ascii', 'stderr'); 59 test(scriptFile.name, 'ascii', 'stderr');
60 test(scriptFile.name, 'latin1', 'stdout'); 60 test(scriptFile.name, 'latin1', 'stdout');
61 test(scriptFile.name, 'latin1', 'stderr'); 61 test(scriptFile.name, 'latin1', 'stderr');
62 test(scriptFile.name, 'utf8', 'stdout'); 62 test(scriptFile.name, 'utf8', 'stdout');
63 test(scriptFile.name, 'utf8', 'stderr'); 63 test(scriptFile.name, 'utf8', 'stderr');
64 64
65 } 65 }
OLDNEW
« no previous file with comments | « runtime/bin/process_impl.dart ('k') | tests/standalone/standalone-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698