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

Side by Side Diff: base/file_util_unittest.cc

Issue 8800025: Adaptively use temp dir instead of /dev/shm for executable shmem file on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up per review Created 9 years 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
« no previous file with comments | « base/file_util_posix.cc ('k') | base/file_util_win.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 temp_dir_.path(), 1538 temp_dir_.path(),
1539 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), 1539 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"),
1540 &new_dir)); 1540 &new_dir));
1541 EXPECT_TRUE(file_util::PathExists(new_dir)); 1541 EXPECT_TRUE(file_util::PathExists(new_dir));
1542 EXPECT_TRUE(temp_dir_.path().IsParent(new_dir)); 1542 EXPECT_TRUE(temp_dir_.path().IsParent(new_dir));
1543 EXPECT_TRUE(file_util::Delete(new_dir, false)); 1543 EXPECT_TRUE(file_util::Delete(new_dir, false));
1544 } 1544 }
1545 1545
1546 TEST_F(FileUtilTest, GetShmemTempDirTest) { 1546 TEST_F(FileUtilTest, GetShmemTempDirTest) {
1547 FilePath dir; 1547 FilePath dir;
1548 EXPECT_TRUE(file_util::GetShmemTempDir(&dir)); 1548 EXPECT_TRUE(file_util::GetShmemTempDir(&dir, false));
1549 EXPECT_TRUE(file_util::DirectoryExists(dir)); 1549 EXPECT_TRUE(file_util::DirectoryExists(dir));
1550 } 1550 }
1551 1551
1552 TEST_F(FileUtilTest, CreateDirectoryTest) { 1552 TEST_F(FileUtilTest, CreateDirectoryTest) {
1553 FilePath test_root = 1553 FilePath test_root =
1554 temp_dir_.path().Append(FILE_PATH_LITERAL("create_directory_test")); 1554 temp_dir_.path().Append(FILE_PATH_LITERAL("create_directory_test"));
1555 #if defined(OS_WIN) 1555 #if defined(OS_WIN)
1556 FilePath test_path = 1556 FilePath test_path =
1557 test_root.Append(FILE_PATH_LITERAL("dir\\tree\\likely\\doesnt\\exist\\")); 1557 test_root.Append(FILE_PATH_LITERAL("dir\\tree\\likely\\doesnt\\exist\\"));
1558 #elif defined(OS_POSIX) 1558 #elif defined(OS_POSIX)
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 file_util::VerifyPathControlledByUser( 2199 file_util::VerifyPathControlledByUser(
2200 base_dir_, text_file_, uid_, ok_gids_)); 2200 base_dir_, text_file_, uid_, ok_gids_));
2201 EXPECT_TRUE( 2201 EXPECT_TRUE(
2202 file_util::VerifyPathControlledByUser( 2202 file_util::VerifyPathControlledByUser(
2203 sub_dir_, text_file_, uid_, ok_gids_)); 2203 sub_dir_, text_file_, uid_, ok_gids_));
2204 } 2204 }
2205 2205
2206 #endif // defined(OS_POSIX) 2206 #endif // defined(OS_POSIX)
2207 2207
2208 } // namespace 2208 } // namespace
OLDNEW
« no previous file with comments | « base/file_util_posix.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698