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

Side by Side Diff: base/file_util_unittest.cc

Issue 1582022: Unpack extensions inside chrome's directory. (Closed)
Patch Set: Final rebase. Created 10 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 | « 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 <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 } 1134 }
1135 1135
1136 TEST_F(FileUtilTest, CreateNewTempDirectoryTest) { 1136 TEST_F(FileUtilTest, CreateNewTempDirectoryTest) {
1137 FilePath temp_dir; 1137 FilePath temp_dir;
1138 ASSERT_TRUE(file_util::CreateNewTempDirectory(FilePath::StringType(), 1138 ASSERT_TRUE(file_util::CreateNewTempDirectory(FilePath::StringType(),
1139 &temp_dir)); 1139 &temp_dir));
1140 EXPECT_TRUE(file_util::PathExists(temp_dir)); 1140 EXPECT_TRUE(file_util::PathExists(temp_dir));
1141 EXPECT_TRUE(file_util::Delete(temp_dir, false)); 1141 EXPECT_TRUE(file_util::Delete(temp_dir, false));
1142 } 1142 }
1143 1143
1144 TEST_F(FileUtilTest, CreateNewTemporaryDirInDirTest) {
1145 FilePath new_dir;
1146 ASSERT_TRUE(file_util::CreateTemporaryDirInDir(
1147 test_dir_,
1148 FILE_PATH_LITERAL("CreateNewTemporaryDirInDirTest"),
1149 &new_dir));
1150 EXPECT_TRUE(file_util::PathExists(new_dir));
1151 EXPECT_TRUE(test_dir_.IsParent(new_dir));
1152 EXPECT_TRUE(file_util::Delete(new_dir, false));
1153 }
1154
1144 TEST_F(FileUtilTest, GetShmemTempDirTest) { 1155 TEST_F(FileUtilTest, GetShmemTempDirTest) {
1145 FilePath dir; 1156 FilePath dir;
1146 EXPECT_TRUE(file_util::GetShmemTempDir(&dir)); 1157 EXPECT_TRUE(file_util::GetShmemTempDir(&dir));
1147 EXPECT_TRUE(file_util::DirectoryExists(dir)); 1158 EXPECT_TRUE(file_util::DirectoryExists(dir));
1148 } 1159 }
1149 1160
1150 TEST_F(FileUtilTest, CreateDirectoryTest) { 1161 TEST_F(FileUtilTest, CreateDirectoryTest) {
1151 FilePath test_root = 1162 FilePath test_root =
1152 test_dir_.Append(FILE_PATH_LITERAL("create_directory_test")); 1163 test_dir_.Append(FILE_PATH_LITERAL("create_directory_test"));
1153 #if defined(OS_WIN) 1164 #if defined(OS_WIN)
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 // modification times with 2s resolution. 1453 // modification times with 2s resolution.
1443 ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT", 1454 ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT",
1444 &modification_time)); 1455 &modification_time));
1445 ASSERT_TRUE(file_util::SetLastModifiedTime(foobar, modification_time)); 1456 ASSERT_TRUE(file_util::SetLastModifiedTime(foobar, modification_time));
1446 file_util::FileInfo file_info; 1457 file_util::FileInfo file_info;
1447 ASSERT_TRUE(file_util::GetFileInfo(foobar, &file_info)); 1458 ASSERT_TRUE(file_util::GetFileInfo(foobar, &file_info));
1448 ASSERT_TRUE(file_info.last_modified == modification_time); 1459 ASSERT_TRUE(file_info.last_modified == modification_time);
1449 } 1460 }
1450 1461
1451 } // namespace 1462 } // 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