OLD | NEW |
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 return it->second; | 119 return it->second; |
120 } | 120 } |
121 | 121 |
122 } // namespace sandboxtest | 122 } // namespace sandboxtest |
123 | 123 |
124 namespace { | 124 namespace { |
125 | 125 |
126 // Main function for driver process that enables the sandbox and runs test | 126 // Main function for driver process that enables the sandbox and runs test |
127 // code. | 127 // code. |
128 MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner) { | 128 MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner, NULL) { |
129 TestContentClient content_client; | 129 TestContentClient content_client; |
130 content::SetContentClient(&content_client); | 130 content::SetContentClient(&content_client); |
131 // Extract parameters. | 131 // Extract parameters. |
132 char* sandbox_type_str = getenv(kSandboxTypeKey); | 132 char* sandbox_type_str = getenv(kSandboxTypeKey); |
133 if (!sandbox_type_str) { | 133 if (!sandbox_type_str) { |
134 LOG(ERROR) << "Sandbox type not specified"; | 134 LOG(ERROR) << "Sandbox type not specified"; |
135 return -1; | 135 return -1; |
136 } | 136 } |
137 content::SandboxType sandbox_type = | 137 content::SandboxType sandbox_type = |
138 static_cast<content::SandboxType>(atoi(sandbox_type_str)); | 138 static_cast<content::SandboxType>(atoi(sandbox_type_str)); |
(...skipping 30 matching lines...) Expand all Loading... |
169 | 169 |
170 if (!test_case->SandboxedTest()) { | 170 if (!test_case->SandboxedTest()) { |
171 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; | 171 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; |
172 return -1; | 172 return -1; |
173 } | 173 } |
174 | 174 |
175 return 0; | 175 return 0; |
176 } | 176 } |
177 | 177 |
178 } // namespace | 178 } // namespace |
OLD | NEW |