Index: content/common/sandbox_mac_system_access_unittest.mm |
diff --git a/content/common/sandbox_mac_system_access_unittest.mm b/content/common/sandbox_mac_system_access_unittest.mm |
index 4ddc73a5988c0de0e012ae93a131ab1112890154..09ac85485d24522009ee1001cdbee73a89103092 100644 |
--- a/content/common/sandbox_mac_system_access_unittest.mm |
+++ b/content/common/sandbox_mac_system_access_unittest.mm |
@@ -5,7 +5,6 @@ |
#import <Cocoa/Cocoa.h> |
#include "base/file_util.h" |
-#include "base/files/scoped_file.h" |
#include "base/logging.h" |
#include "base/strings/sys_string_conversions.h" |
#include "content/common/sandbox_mac.h" |
@@ -87,8 +86,9 @@ |
REGISTER_SANDBOX_TEST_CASE(MacSandboxedFileAccessTestCase); |
bool MacSandboxedFileAccessTestCase::SandboxedTest() { |
- base::ScopedFD fdes(open("/etc/passwd", O_RDONLY)); |
- return !fdes.is_valid(); |
+ int fdes = open("/etc/passwd", O_RDONLY); |
+ file_util::ScopedFD file_closer(&fdes); |
+ return fdes == -1; |
} |
TEST_F(MacSandboxTest, FileAccess) { |
@@ -105,14 +105,15 @@ |
REGISTER_SANDBOX_TEST_CASE(MacSandboxedUrandomTestCase); |
bool MacSandboxedUrandomTestCase::SandboxedTest() { |
- base::ScopedFD fdes(open("/dev/urandom", O_RDONLY)); |
+ int fdes = open("/dev/urandom", O_RDONLY); |
+ file_util::ScopedFD file_closer(&fdes); |
// Opening /dev/urandom succeeds under the sandbox. |
- if (!fdes.is_valid()) |
+ if (fdes == -1) |
return false; |
char buf[16]; |
- int rc = read(fdes.get(), buf, sizeof(buf)); |
+ int rc = read(fdes, buf, sizeof(buf)); |
return rc == sizeof(buf); |
} |