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

Side by Side Diff: content/common/sandbox_mac_unittest_helper.mm

Issue 191483002: Get rid of multiprocess_test's debug_on_start arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restore ipc_switches.* Created 6 years, 9 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 | « content/common/sandbox_mac_diraccess_unittest.mm ('k') | ipc/ipc_channel_posix_unittest.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "content/common/sandbox_mac_unittest_helper.h" 5 #include "content/common/sandbox_mac_unittest_helper.h"
6 6
7 extern "C" { 7 extern "C" {
8 #include <sandbox.h> 8 #include <sandbox.h>
9 } 9 }
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool MacSandboxTest::RunTestInSandbox(SandboxType sandbox_type, 71 bool MacSandboxTest::RunTestInSandbox(SandboxType sandbox_type,
72 const char* test_name, 72 const char* test_name,
73 const char* test_data) { 73 const char* test_data) {
74 std::stringstream s; 74 std::stringstream s;
75 s << static_cast<int>(static_cast<int>(sandbox_type)); 75 s << static_cast<int>(static_cast<int>(sandbox_type));
76 setenv(kSandboxTypeKey, s.str().c_str(), 1); 76 setenv(kSandboxTypeKey, s.str().c_str(), 1);
77 setenv(kSandboxTestNameKey, test_name, 1); 77 setenv(kSandboxTestNameKey, test_name, 1);
78 if (test_data) 78 if (test_data)
79 setenv(kTestDataKey, test_data, 1); 79 setenv(kTestDataKey, test_data, 1);
80 80
81 base::ProcessHandle child_process = SpawnChild("mac_sandbox_test_runner", 81 base::ProcessHandle child_process = SpawnChild("mac_sandbox_test_runner");
82 false);
83 if (child_process == base::kNullProcessHandle) { 82 if (child_process == base::kNullProcessHandle) {
84 LOG(WARNING) << "SpawnChild failed"; 83 LOG(WARNING) << "SpawnChild failed";
85 return false; 84 return false;
86 } 85 }
87 int code = -1; 86 int code = -1;
88 if (!base::WaitForExitCode(child_process, &code)) { 87 if (!base::WaitForExitCode(child_process, &code)) {
89 LOG(WARNING) << "base::WaitForExitCode failed"; 88 LOG(WARNING) << "base::WaitForExitCode failed";
90 return false; 89 return false;
91 } 90 }
92 return code == 0; 91 return code == 0;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 161
163 if (!test_case->SandboxedTest()) { 162 if (!test_case->SandboxedTest()) {
164 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; 163 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test";
165 return -1; 164 return -1;
166 } 165 }
167 166
168 return 0; 167 return 0;
169 } 168 }
170 169
171 } // namespace content 170 } // namespace content
OLDNEW
« no previous file with comments | « content/common/sandbox_mac_diraccess_unittest.mm ('k') | ipc/ipc_channel_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698