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

Unified Diff: tests/standalone/io/platform_resolved_executable_test.dart

Issue 1182423003: Revert "Clean up process spawning." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « runtime/bin/process_macos.cc ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/platform_resolved_executable_test.dart
diff --git a/tests/standalone/io/platform_resolved_executable_test.dart b/tests/standalone/io/platform_resolved_executable_test.dart
index c8a617484b926ef97a6e709f75736007fd749c63..b5ae47c1f3415e1e718b68de1dee9c7a4913b344 100644
--- a/tests/standalone/io/platform_resolved_executable_test.dart
+++ b/tests/standalone/io/platform_resolved_executable_test.dart
@@ -43,11 +43,20 @@ void testDartExecShouldNotBeInCurrentDir() {
expectEquals(FileSystemEntityType.NOT_FOUND, type);
}
-void testShouldSucceedWithEmptyPathEnvironment() {
- var command = Platform.isWindows ? 'cmd' : 'ls';
- Process.runSync(command, [],
- includeParentEnvironment: false,
- environment: {_SCRIPT_KEY: 'yes', 'PATH': ''});
+void testShouldFailOutsidePath() {
+ var threw = false;
+ try {
+ Process.runSync(platformExeName, ['--version'],
+ includeParentEnvironment: false,
+ environment: {_SCRIPT_KEY: 'yes', 'PATH': ''});
+ } catch (_) {
+ threw = true;
+ }
+
+ if (!threw) {
+ throw 'Expected running the dart executable – "$platformExeName" without'
+ ' the parent environment or path to fail.';
+ }
}
void testShouldSucceedWithSourcePlatformExecutable() {
@@ -144,5 +153,5 @@ void main() {
if (!Platform.isWindows) {
withTempDir(testPathToDirWithExeSymLinked); /// 05: ok
}
- testShouldSucceedWithEmptyPathEnvironment(); /// 06: ok
+ testShouldFailOutsidePath(); /// 06: ok
}
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698