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

Unified Diff: tests/standalone/src/io/ProcessStderrTest.dart

Issue 10252020: test rename overhaul: step 12 - standalone (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/src/io/ProcessStdIOScript2.dart ('k') | tests/standalone/src/io/ProcessStdoutTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/ProcessStderrTest.dart
diff --git a/tests/standalone/src/io/ProcessStderrTest.dart b/tests/standalone/src/io/ProcessStderrTest.dart
deleted file mode 100644
index f8e8b0a3862c7a9add75d79730618b322089c0ee..0000000000000000000000000000000000000000
--- a/tests/standalone/src/io/ProcessStderrTest.dart
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-//
-// Process test program to test process communication.
-//
-// VMOptions=
-// VMOptions=--short_socket_read
-// VMOptions=--short_socket_write
-// VMOptions=--short_socket_read --short_socket_write
-
-#import("dart:io");
-#source("ProcessTestUtil.dart");
-
-void test(Process process, int expectedExitCode) {
- // Wait for the process to start and then interact with it.
- process.onStart = () {
- List<int> data = "ABCDEFGHI\n".charCodes();
- final int dataSize = data.length;
-
- InputStream input = process.stderr;
- OutputStream output = process.stdin;
-
- int received = 0;
- List<int> buffer = [];
-
- void readData() {
- buffer.addAll(input.read());
- for (int i = received;
- i < Math.min(data.length, buffer.length) - 1;
- i++) {
- Expect.equals(data[i], buffer[i]);
- }
- received = buffer.length;
- if (received >= dataSize) {
- // We expect an extra character on windows due to carriage return.
- if (13 === buffer[dataSize - 1] && dataSize + 1 === received) {
- Expect.equals(13, buffer[dataSize - 1]);
- Expect.equals(10, buffer[dataSize]);
- buffer.removeLast();
- process.close();
- } else if (received === dataSize) {
- process.close();
- }
- }
- }
-
- output.write(data);
- output.close();
- input.onData = readData;
- };
-
- process.onExit = (exitCode) {
- Expect.equals(expectedExitCode, exitCode);
- };
-}
-
-main() {
- // Run the test using the process_test binary.
- test(new Process.start(getProcessTestFileName(),
- const ["1", "1", "99", "0"]), 99);
-
- // Run the test using the dart binary with an echo script.
- // The test runner can be run from either the root or from runtime.
- var scriptFile = new File("tests/standalone/src/io/ProcessStdIOScript.dart");
- if (!scriptFile.existsSync()) {
- scriptFile = new File("../tests/standalone/src/io/ProcessStdIOScript.dart");
- }
- Expect.isTrue(scriptFile.existsSync());
- test(new Process.start(getDartFileName(), [scriptFile.name, "1"]), 0);
-}
« no previous file with comments | « tests/standalone/src/io/ProcessStdIOScript2.dart ('k') | tests/standalone/src/io/ProcessStdoutTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698