| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 #include <dirent.h> | 6 #include <dirent.h> |
| 7 | 7 |
| 8 extern "C" { | 8 extern "C" { |
| 9 #include <sandbox.h> | 9 #include <sandbox.h> |
| 10 } | 10 } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 public: | 135 public: |
| 136 inline void operator()(FilePath* x) const { | 136 inline void operator()(FilePath* x) const { |
| 137 if (x) { | 137 if (x) { |
| 138 file_util::Delete(*x, true); | 138 file_util::Delete(*x, true); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 typedef scoped_ptr_malloc<FilePath, ScopedDirectoryDelete> ScopedDirectory; | 143 typedef scoped_ptr_malloc<FilePath, ScopedDirectoryDelete> ScopedDirectory; |
| 144 | 144 |
| 145 TEST_F(MacDirAccessSandboxTest, SandboxAccess) { | 145 // Disabled as times out, taking out remaining tests: 89170. |
| 146 TEST_F(MacDirAccessSandboxTest, DISABLED_SandboxAccess) { |
| 146 using file_util::CreateDirectory; | 147 using file_util::CreateDirectory; |
| 147 | 148 |
| 148 FilePath tmp_dir; | 149 FilePath tmp_dir; |
| 149 ASSERT_TRUE(file_util::CreateNewTempDirectory("", &tmp_dir)); | 150 ASSERT_TRUE(file_util::CreateNewTempDirectory("", &tmp_dir)); |
| 150 // This step is important on OS X since the sandbox only understands "real" | 151 // This step is important on OS X since the sandbox only understands "real" |
| 151 // paths and the paths CreateNewTempDirectory() returns are empirically in | 152 // paths and the paths CreateNewTempDirectory() returns are empirically in |
| 152 // /var which is a symlink to /private/var . | 153 // /var which is a symlink to /private/var . |
| 153 Sandbox::GetCanonicalSandboxPath(&tmp_dir); | 154 Sandbox::GetCanonicalSandboxPath(&tmp_dir); |
| 154 ScopedDirectory cleanup(&tmp_dir); | 155 ScopedDirectory cleanup(&tmp_dir); |
| 155 | 156 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 PLOG(ERROR) << "Sandbox breach: was able to write (" | 300 PLOG(ERROR) << "Sandbox breach: was able to write (" |
| 300 << denied_file2.value() | 301 << denied_file2.value() |
| 301 << ")"; | 302 << ")"; |
| 302 return -1; | 303 return -1; |
| 303 } | 304 } |
| 304 | 305 |
| 305 return 0; | 306 return 0; |
| 306 } | 307 } |
| 307 | 308 |
| 308 } // namespace sandbox | 309 } // namespace sandbox |
| OLD | NEW |