Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1203)

Unified Diff: content/common/sandbox_mac_system_access_unittest.mm

Issue 197873014: Revert of Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_mac.mm ('k') | ipc/ipc_channel_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « content/common/sandbox_mac.mm ('k') | ipc/ipc_channel_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698