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

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

Issue 123263003: Make the Platform.environment return value an unmodifiable map (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/platform_impl.dart ('k') | tools/testing/dart/test_runner.dart » ('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 import "dart:io"; 5 import "dart:io";
6 6
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 import "process_test_util.dart"; 10 import "process_test_util.dart";
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Only check one value to not spin up too many processes testing the 58 // Only check one value to not spin up too many processes testing the
59 // same things. 59 // same things.
60 break; 60 break;
61 } 61 }
62 } 62 }
63 63
64 testNoIncludeEnvironment() { 64 testNoIncludeEnvironment() {
65 asyncStart(); 65 asyncStart();
66 var env = Platform.environment; 66 var env = Platform.environment;
67 Expect.isTrue(env.containsKey('PATH')); 67 Expect.isTrue(env.containsKey('PATH'));
68 env = new Map.from(env);
68 env.remove('PATH'); 69 env.remove('PATH');
69 runEnvironmentProcess(env, "PATH", false, (output) { 70 runEnvironmentProcess(env, "PATH", false, (output) {
70 Expect.isTrue(output.startsWith("null")); 71 Expect.isTrue(output.startsWith("null"));
71 asyncEnd(); 72 asyncEnd();
72 }); 73 });
73 } 74 }
74 75
75 main() { 76 main() {
76 testEnvironment(); 77 testEnvironment();
77 testNoIncludeEnvironment(); 78 testNoIncludeEnvironment();
78 } 79 }
OLDNEW
« no previous file with comments | « sdk/lib/io/platform_impl.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698