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

Side by Side Diff: webrtc/test/testsupport/fileutils.cc

Issue 2885393002: Revert of Reduce dependencies on rtc::FileSystem in FileRotatingStream tests... (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « webrtc/test/testsupport/fileutils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } else { 225 } else {
226 #ifdef WIN32 226 #ifdef WIN32
227 return _mkdir(directory_name.c_str()) == 0; 227 return _mkdir(directory_name.c_str()) == 0;
228 #else 228 #else
229 return mkdir(directory_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) == 0; 229 return mkdir(directory_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) == 0;
230 #endif 230 #endif
231 } 231 }
232 return true; 232 return true;
233 } 233 }
234 234
235 bool RemoveDir(const std::string& directory_name) {
236 #ifdef WIN32
237 return RemoveDirectoryA(directory_name.c_str()) != FALSE;
238 #else
239 return rmdir(directory_name.c_str()) == 0;
240 #endif
241 }
242
243 bool RemoveFile(const std::string& file_name) {
244 #ifdef WIN32
245 return DeleteFileA(file_name.c_str()) != FALSE;
246 #else
247 return unlink(file_name.c_str()) == 0;
248 #endif
249 }
250
251 std::string ResourcePath(const std::string& name, 235 std::string ResourcePath(const std::string& name,
252 const std::string& extension) { 236 const std::string& extension) {
253 #if defined(WEBRTC_IOS) 237 #if defined(WEBRTC_IOS)
254 return IOSResourcePath(name, extension); 238 return IOSResourcePath(name, extension);
255 #else 239 #else
256 std::string platform = "win"; 240 std::string platform = "win";
257 #ifdef WEBRTC_LINUX 241 #ifdef WEBRTC_LINUX
258 platform = "linux"; 242 platform = "linux";
259 #endif // WEBRTC_LINUX 243 #endif // WEBRTC_LINUX
260 #ifdef WEBRTC_MAC 244 #ifdef WEBRTC_MAC
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (fseek(f, 0, SEEK_END) == 0) { 284 if (fseek(f, 0, SEEK_END) == 0) {
301 size = ftell(f); 285 size = ftell(f);
302 } 286 }
303 fclose(f); 287 fclose(f);
304 } 288 }
305 return size; 289 return size;
306 } 290 }
307 291
308 } // namespace test 292 } // namespace test
309 } // namespace webrtc 293 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/testsupport/fileutils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698