Chromium Code Reviews| Index: content/common/sandbox_mac_unittest_helper.mm |
| diff --git a/content/common/sandbox_mac_unittest_helper.mm b/content/common/sandbox_mac_unittest_helper.mm |
| index 3b0345d05d80171a6c5ad6d7b1f637f010610bd6..2c1bcc40d679524d07dda8492f58fc7c7f894548 100644 |
| --- a/content/common/sandbox_mac_unittest_helper.mm |
| +++ b/content/common/sandbox_mac_unittest_helper.mm |
| @@ -14,6 +14,7 @@ extern "C" { |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "content/common/sandbox_mac.h" |
| +#include "content/test/test_content_client.h" |
| #include "testing/multiprocess_func_list.h" |
| using sandbox::Sandbox; |
| @@ -54,11 +55,11 @@ bool MacSandboxTest::RunTestInAllSandboxTypes(const char* test_name, |
| const char* test_data) { |
| // Go through all the sandbox types, and run the test case in each of them |
| // if one fails, abort. |
| - for(int i = static_cast<int>(Sandbox::SANDBOX_TYPE_FIRST_TYPE); |
| - i < Sandbox::SANDBOX_AFTER_TYPE_LAST_TYPE; |
| + for(int i = static_cast<int>(content::SANDBOX_TYPE_FIRST_TYPE); |
| + i < content::SANDBOX_AFTER_TYPE_LAST_TYPE; |
| ++i) { |
|
jeremy
2011/11/23 07:02:17
Don't we lose coverage here since we won't be chec
jochen (gone - plz use gerrit)
2011/11/23 10:57:28
Yes and no.
The NaCL sandbox is exercised by the
|
| - if (!RunTestInSandbox(static_cast<Sandbox::SandboxProcessType>(i), |
| + if (!RunTestInSandbox(static_cast<content::SandboxProcessType>(i), |
| test_name, test_data)) { |
| LOG(ERROR) << "Sandboxed test (" << test_name << ")" << |
| "Failed in sandbox type " << i << |
| @@ -69,7 +70,7 @@ bool MacSandboxTest::RunTestInAllSandboxTypes(const char* test_name, |
| return true; |
| } |
| -bool MacSandboxTest::RunTestInSandbox(Sandbox::SandboxProcessType sandbox_type, |
| +bool MacSandboxTest::RunTestInSandbox(content::SandboxProcessType sandbox_type, |
| const char* test_name, |
| const char* test_data) { |
| std::stringstream s; |
| @@ -125,14 +126,16 @@ namespace { |
| // Main function for driver process that enables the sandbox and runs test |
| // code. |
| MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner) { |
| + TestContentClient content_client; |
| + content::SetContentClient(&content_client); |
| // Extract parameters. |
| char* sandbox_type_str = getenv(kSandboxTypeKey); |
| if (!sandbox_type_str) { |
| LOG(ERROR) << "Sandbox type not specified"; |
| return -1; |
| } |
| - Sandbox::SandboxProcessType sandbox_type = |
| - static_cast<Sandbox::SandboxProcessType>(atoi(sandbox_type_str)); |
| + content::SandboxProcessType sandbox_type = |
| + static_cast<content::SandboxProcessType>(atoi(sandbox_type_str)); |
| char* sandbox_test_name = getenv(kSandboxTestNameKey); |
| if (!sandbox_test_name) { |
| LOG(ERROR) << "Sandbox test name not specified"; |