| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #define _CRT_SECURE_NO_WARNINGS | 5 #define _CRT_SECURE_NO_WARNINGS | 
| 6 | 6 | 
| 7 #include <limits> | 7 #include <limits> | 
| 8 | 8 | 
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" | 
| 10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" | 
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 57 #if defined(OS_MACOSX) | 57 #if defined(OS_MACOSX) | 
| 58 #include <mach/vm_param.h> | 58 #include <mach/vm_param.h> | 
| 59 #include <malloc/malloc.h> | 59 #include <malloc/malloc.h> | 
| 60 #include "base/mac/mac_util.h" | 60 #include "base/mac/mac_util.h" | 
| 61 #endif | 61 #endif | 
| 62 | 62 | 
| 63 using base::FilePath; | 63 using base::FilePath; | 
| 64 | 64 | 
| 65 namespace { | 65 namespace { | 
| 66 | 66 | 
|  | 67 const char kSignalFileSlow[] = "SlowChildProcess.die"; | 
|  | 68 const char kSignalFileKill[] = "KilledChildProcess.die"; | 
|  | 69 | 
|  | 70 #if defined(OS_POSIX) | 
|  | 71 const char kSignalFileTerm[] = "TerminatedChildProcess.die"; | 
|  | 72 | 
| 67 #if defined(OS_ANDROID) | 73 #if defined(OS_ANDROID) | 
| 68 const char kShellPath[] = "/system/bin/sh"; | 74 const char kShellPath[] = "/system/bin/sh"; | 
| 69 const char kPosixShell[] = "sh"; | 75 const char kPosixShell[] = "sh"; | 
| 70 #else | 76 #else | 
| 71 const char kShellPath[] = "/bin/sh"; | 77 const char kShellPath[] = "/bin/sh"; | 
| 72 const char kPosixShell[] = "bash"; | 78 const char kPosixShell[] = "bash"; | 
| 73 #endif | 79 #endif | 
| 74 | 80 #endif  // defined(OS_POSIX) | 
| 75 const char kSignalFileSlow[] = "SlowChildProcess.die"; |  | 
| 76 const char kSignalFileKill[] = "KilledChildProcess.die"; |  | 
| 77 |  | 
| 78 #if defined(OS_POSIX) |  | 
| 79 const char kSignalFileTerm[] = "TerminatedChildProcess.die"; |  | 
| 80 #endif |  | 
| 81 | 81 | 
| 82 #if defined(OS_WIN) | 82 #if defined(OS_WIN) | 
| 83 const int kExpectedStillRunningExitCode = 0x102; | 83 const int kExpectedStillRunningExitCode = 0x102; | 
| 84 const int kExpectedKilledExitCode = 1; | 84 const int kExpectedKilledExitCode = 1; | 
| 85 #else | 85 #else | 
| 86 const int kExpectedStillRunningExitCode = 0; | 86 const int kExpectedStillRunningExitCode = 0; | 
| 87 #endif | 87 #endif | 
| 88 | 88 | 
| 89 // Sleeps until file filename is created. | 89 // Sleeps until file filename is created. | 
| 90 void WaitToDie(const char* filename) { | 90 void WaitToDie(const char* filename) { | 
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1105   options.current_directory = base::FilePath("/dev/null"); | 1105   options.current_directory = base::FilePath("/dev/null"); | 
| 1106 | 1106 | 
| 1107   base::Process process(SpawnChildWithOptions("SimpleChildProcess", options)); | 1107   base::Process process(SpawnChildWithOptions("SimpleChildProcess", options)); | 
| 1108   ASSERT_TRUE(process.IsValid()); | 1108   ASSERT_TRUE(process.IsValid()); | 
| 1109 | 1109 | 
| 1110   int exit_code = kSuccess; | 1110   int exit_code = kSuccess; | 
| 1111   EXPECT_TRUE(process.WaitForExit(&exit_code)); | 1111   EXPECT_TRUE(process.WaitForExit(&exit_code)); | 
| 1112   EXPECT_NE(kSuccess, exit_code); | 1112   EXPECT_NE(kSuccess, exit_code); | 
| 1113 } | 1113 } | 
| 1114 #endif | 1114 #endif | 
| OLD | NEW | 
|---|