diff options
-rw-r--r-- | chrome/common/sandbox_mac_system_access_unittest.mm | 4 | ||||
-rw-r--r-- | chrome/common/sandbox_mac_unittest_helper.h | 2 | ||||
-rw-r--r-- | chrome/common/sandbox_mac_unittest_helper.mm | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/chrome/common/sandbox_mac_system_access_unittest.mm b/chrome/common/sandbox_mac_system_access_unittest.mm index 3ae41d7..382aa2c 100644 --- a/chrome/common/sandbox_mac_system_access_unittest.mm +++ b/chrome/common/sandbox_mac_system_access_unittest.mm @@ -67,11 +67,11 @@ void MacSandboxedClipboardTestCase::SetTestData(const char* test_data) { TEST_F(MacSandboxTest, ClipboardAccess) { NSPasteboard* pb = [NSPasteboard pasteboardWithUniqueName]; EXPECT_EQ([[pb types] count], 0U); - + std::string pasteboard_name = base::SysNSStringToUTF8([pb name]); EXPECT_TRUE(RunTestInAllSandboxTypes("MacSandboxedClipboardTestCase", pasteboard_name.c_str())); - + // After executing the test, the clipboard should still be empty. EXPECT_EQ([[pb types] count], 0U); } diff --git a/chrome/common/sandbox_mac_unittest_helper.h b/chrome/common/sandbox_mac_unittest_helper.h index 24a8b4c..3e24009 100644 --- a/chrome/common/sandbox_mac_unittest_helper.h +++ b/chrome/common/sandbox_mac_unittest_helper.h @@ -78,7 +78,7 @@ class MacSandboxTestCase { // enabled. // Returning false from this function will cause the entire test case to fail. virtual bool SandboxedTest() = 0; - + // The data that's passed in the |user_data| parameter of // RunTest[s]InSandbox() is passed to this function. virtual void SetTestData(const char* test_data) { test_data_ = test_data; } diff --git a/chrome/common/sandbox_mac_unittest_helper.mm b/chrome/common/sandbox_mac_unittest_helper.mm index 328e411..a14370f 100644 --- a/chrome/common/sandbox_mac_unittest_helper.mm +++ b/chrome/common/sandbox_mac_unittest_helper.mm @@ -70,7 +70,7 @@ bool MacSandboxTest::RunTestInSandbox(sandbox::SandboxProcessType sandbox_type, setenv(kSandboxTestNameKey, test_name, 1); if (test_data) setenv(kTestDataKey, test_data, 1); - + base::ProcessHandle child_process = SpawnChild(L"mac_sandbox_test_runner"); int code = -1; if (!base::WaitForExitCode(child_process, &code)) { @@ -117,9 +117,9 @@ MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner) { LOG(ERROR) << "Sandbox test name not specified"; return -1; } - + const char* test_data = getenv(kTestDataKey); - + // Find Test Function to run; scoped_ptr<sandboxtest::MacSandboxTestCase> test_case(sandboxtest::SandboxTestForName(sandbox_test_name)); @@ -128,25 +128,25 @@ MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner) { return -1; } test_case->SetTestData(test_data); - + // Run Test. if (!test_case->BeforeSandboxInit()) { LOG(ERROR) << sandbox_test_name << "Failed test before sandbox init"; return -1; } - + sandbox::SandboxWarmup(); - + if (!sandbox::EnableSandbox(sandbox_type, FilePath())) { LOG(ERROR) << "Failed to initialize sandbox " << sandbox_type; return -1; } - + if (!test_case->SandboxedTest()) { LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; return -1; } - + return 0; } |