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

Side by Side Diff: tests/standalone/io/process_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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'package:path/path.dart'; 6 import 'package:path/path.dart';
7 import "dart:io"; 7 import "dart:io";
8 8
9 test(int blockCount, 9 test(int blockCount,
10 int stdoutBlockSize, 10 int stdoutBlockSize,
11 int stderrBlockSize, 11 int stderrBlockSize,
12 int exitCode, 12 int exitCode,
13 [int nonWindowsExitCode]) { 13 [int nonWindowsExitCode]) {
14 // Get the Dart script file that generates output. 14 // Get the Dart script file that generates output.
15 var scriptFile = new File(join(dirname(Platform.script), 15 var scriptFile = new File(Platform.script
16 "process_sync_script.dart")); 16 .resolve("process_sync_script.dart")
17 .toFilePath());
17 var args = [scriptFile.path, 18 var args = [scriptFile.path,
18 blockCount.toString(), 19 blockCount.toString(),
19 stdoutBlockSize.toString(), 20 stdoutBlockSize.toString(),
20 stderrBlockSize.toString(), 21 stderrBlockSize.toString(),
21 exitCode.toString()]; 22 exitCode.toString()];
22 ProcessResult syncResult = Process.runSync(Platform.executable, args); 23 ProcessResult syncResult = Process.runSync(Platform.executable, args);
23 Expect.equals(blockCount * stdoutBlockSize, syncResult.stdout.length); 24 Expect.equals(blockCount * stdoutBlockSize, syncResult.stdout.length);
24 Expect.equals(blockCount * stderrBlockSize, syncResult.stderr.length); 25 Expect.equals(blockCount * stderrBlockSize, syncResult.stderr.length);
25 if (Platform.isWindows) { 26 if (Platform.isWindows) {
26 Expect.equals(exitCode, syncResult.exitCode); 27 Expect.equals(exitCode, syncResult.exitCode);
(...skipping 25 matching lines...) Expand all
52 test(1, kBufferSize, kBufferSize, 0); 53 test(1, kBufferSize, kBufferSize, 0);
53 test(1, kBufferSize - 1, kBufferSize - 1, 0); 54 test(1, kBufferSize - 1, kBufferSize - 1, 0);
54 test(1, kBufferSize + 1, kBufferSize + 1, 0); 55 test(1, kBufferSize + 1, kBufferSize + 1, 0);
55 56
56 test(10, 10, 10, 1); 57 test(10, 10, 10, 1);
57 test(10, 10, 10, 255); 58 test(10, 10, 10, 255);
58 test(10, 10, 10, -1, 255); 59 test(10, 10, 10, -1, 255);
59 test(10, 10, 10, -255, 1); 60 test(10, 10, 10, -255, 1);
60 } 61 }
61 62
OLDNEW
« no previous file with comments | « tests/standalone/io/process_shell_test.dart ('k') | tests/standalone/io/raw_secure_server_closing_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698