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

Side by Side Diff: base/file_util_unittest.cc

Issue 2802018: Loosen permission on extension temp dir when a flag is used. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rebase for commit. Created 10 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
« 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <winioctl.h> 9 #include <winioctl.h>
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 &temp_dir)); 1562 &temp_dir));
1563 EXPECT_TRUE(file_util::PathExists(temp_dir)); 1563 EXPECT_TRUE(file_util::PathExists(temp_dir));
1564 EXPECT_TRUE(file_util::Delete(temp_dir, false)); 1564 EXPECT_TRUE(file_util::Delete(temp_dir, false));
1565 } 1565 }
1566 1566
1567 TEST_F(FileUtilTest, CreateNewTemporaryDirInDirTest) { 1567 TEST_F(FileUtilTest, CreateNewTemporaryDirInDirTest) {
1568 FilePath new_dir; 1568 FilePath new_dir;
1569 ASSERT_TRUE(file_util::CreateTemporaryDirInDir( 1569 ASSERT_TRUE(file_util::CreateTemporaryDirInDir(
1570 test_dir_, 1570 test_dir_,
1571 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"), 1571 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"),
1572 false,
1572 &new_dir)); 1573 &new_dir));
1573 EXPECT_TRUE(file_util::PathExists(new_dir)); 1574 EXPECT_TRUE(file_util::PathExists(new_dir));
1574 EXPECT_TRUE(test_dir_.IsParent(new_dir)); 1575 EXPECT_TRUE(test_dir_.IsParent(new_dir));
1575 EXPECT_TRUE(file_util::Delete(new_dir, false)); 1576 EXPECT_TRUE(file_util::Delete(new_dir, false));
1576 } 1577 }
1577 1578
1578 TEST_F(FileUtilTest, GetShmemTempDirTest) { 1579 TEST_F(FileUtilTest, GetShmemTempDirTest) {
1579 FilePath dir; 1580 FilePath dir;
1580 EXPECT_TRUE(file_util::GetShmemTempDir(&dir)); 1581 EXPECT_TRUE(file_util::GetShmemTempDir(&dir));
1581 EXPECT_TRUE(file_util::DirectoryExists(dir)); 1582 EXPECT_TRUE(file_util::DirectoryExists(dir));
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir)); 1849 EXPECT_TRUE(file_util::IsDirectoryEmpty(empty_dir));
1849 1850
1850 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt"))); 1851 FilePath foo(empty_dir.Append(FILE_PATH_LITERAL("foo.txt")));
1851 std::string bar("baz"); 1852 std::string bar("baz");
1852 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length())); 1853 ASSERT_TRUE(file_util::WriteFile(foo, bar.c_str(), bar.length()));
1853 1854
1854 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir)); 1855 EXPECT_FALSE(file_util::IsDirectoryEmpty(empty_dir));
1855 } 1856 }
1856 1857
1857 } // namespace 1858 } // 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