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

Side by Side Diff: content/common/sandbox_mac_diraccess_unittest.mm

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 EXPECT_EQ(expected, out); 128 EXPECT_EQ(expected, out);
129 129
130 } 130 }
131 } 131 }
132 132
133 // A class to handle auto-deleting a directory. 133 // A class to handle auto-deleting a directory.
134 class ScopedDirectoryDelete { 134 class ScopedDirectoryDelete {
135 public: 135 public:
136 inline void operator()(base::FilePath* x) const { 136 inline void operator()(base::FilePath* x) const {
137 if (x) { 137 if (x) {
138 file_util::Delete(*x, true); 138 base::Delete(*x, true);
139 } 139 }
140 } 140 }
141 }; 141 };
142 142
143 typedef scoped_ptr_malloc<base::FilePath, ScopedDirectoryDelete> 143 typedef scoped_ptr_malloc<base::FilePath, ScopedDirectoryDelete>
144 ScopedDirectory; 144 ScopedDirectory;
145 145
146 TEST_F(MacDirAccessSandboxTest, SandboxAccess) { 146 TEST_F(MacDirAccessSandboxTest, SandboxAccess) {
147 using file_util::CreateDirectory; 147 using file_util::CreateDirectory;
148 148
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 PLOG(ERROR) << "Sandbox breach: was able to write (" 301 PLOG(ERROR) << "Sandbox breach: was able to write ("
302 << denied_file2.value() 302 << denied_file2.value()
303 << ")"; 303 << ")";
304 return -1; 304 return -1;
305 } 305 }
306 306
307 return 0; 307 return 0;
308 } 308 }
309 309
310 } // namespace content 310 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698