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

Unified Diff: tests/standalone/src/io/ProcessEnvironmentTest.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
Index: tests/standalone/src/io/ProcessEnvironmentTest.dart
diff --git a/tests/standalone/src/io/ProcessEnvironmentTest.dart b/tests/standalone/src/io/ProcessEnvironmentTest.dart
deleted file mode 100644
index e267f66089eae812f30632dcac404c75bfbefd54..0000000000000000000000000000000000000000
--- a/tests/standalone/src/io/ProcessEnvironmentTest.dart
+++ /dev/null
@@ -1,57 +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.
-
-#import('dart:io');
-#import('dart:isolate');
-#source('ProcessTestUtil.dart');
-
-runEnvironmentProcess(Map environment, name, callback) {
- var dartExecutable = getDartFileName();
- var options = new ProcessOptions();
- options.environment = environment;
- var printEnv = 'tests/standalone/src/io/PrintEnv.dart';
- if (!new File(printEnv).existsSync()) {
- printEnv = '../$printEnv';
- }
- var process = new Process.run(dartExecutable,
- [printEnv, name],
- options,
- (exit, out, err) {
- Expect.equals(0, exit);
- callback(out);
- });
- process.onError = (e) => Expect.fail("Unexpected process start error: '$e'");
-}
-
-testEnvironment() {
- var donePort = new ReceivePort();
- Map env = Platform.environment();
- Expect.isFalse(env.isEmpty());
- // Check that some value in the environment stays the same when passed
- // to another process.
- for (var k in env.getKeys()) {
- runEnvironmentProcess(env, k, (output) {
- // Only check startsWith. The print statements will add
- // newlines at the end.
- Expect.isTrue(output.startsWith(env[k]));
- // Add a new variable and check that it becomes an environment
- // variable in the child process.
- var copy = new Map.from(env);
- var name = 'MYENVVAR';
- while (env.containsKey(name)) name = '${name}_';
- copy[name] = 'value';
- runEnvironmentProcess(copy, name, (output) {
- Expect.isTrue(output.startsWith('value'));
- donePort.close();
- });
- });
- // Only check one value to not spin up too many processes testing the
- // same things.
- break;
- }
-}
-
-main() {
- testEnvironment();
-}
« no previous file with comments | « tests/standalone/src/io/ProcessCheckArgumentsTest.dart ('k') | tests/standalone/src/io/ProcessExitNegativeTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698