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

Side by Side Diff: base/files/file_util_posix.cc

Issue 1273243002: Updates to base unittests so they run correctly in libchrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « base/files/file_path_unittest.cc ('k') | base/strings/sys_string_conversions_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/files/file_util.h" 5 #include "base/files/file_util.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <libgen.h> 10 #include <libgen.h>
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 447
448 #if !defined(OS_MACOSX) 448 #if !defined(OS_MACOSX)
449 // This is implemented in file_util_mac.mm for Mac. 449 // This is implemented in file_util_mac.mm for Mac.
450 bool GetTempDir(FilePath* path) { 450 bool GetTempDir(FilePath* path) {
451 const char* tmp = getenv("TMPDIR"); 451 const char* tmp = getenv("TMPDIR");
452 if (tmp) { 452 if (tmp) {
453 *path = FilePath(tmp); 453 *path = FilePath(tmp);
454 } else { 454 } else {
455 #if defined(OS_ANDROID) 455 #if defined(OS_ANDROID)
456 return PathService::Get(base::DIR_CACHE, path); 456 return PathService::Get(base::DIR_CACHE, path);
457 #elif defined(__BRILLO__)
458 *path = FilePath("/data/local/tmp");
Daniel Erat 2015/08/06 23:25:09 i think that this one shouldn't be upstreamed; __B
arihc 2015/08/06 23:51:22 Done.
457 #else 459 #else
458 *path = FilePath("/tmp"); 460 *path = FilePath("/tmp");
459 #endif 461 #endif
460 } 462 }
461 return true; 463 return true;
462 } 464 }
463 #endif // !defined(OS_MACOSX) 465 #endif // !defined(OS_MACOSX)
464 466
465 #if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm. 467 #if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm.
466 FilePath GetHomeDir() { 468 FilePath GetHomeDir() {
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 return false; 928 return false;
927 929
928 DeleteFile(from_path, true); 930 DeleteFile(from_path, true);
929 return true; 931 return true;
930 } 932 }
931 933
932 } // namespace internal 934 } // namespace internal
933 935
934 #endif // !defined(OS_NACL_NONSFI) 936 #endif // !defined(OS_NACL_NONSFI)
935 } // namespace base 937 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_unittest.cc ('k') | base/strings/sys_string_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698