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

Side by Side Diff: base/file_util_unittest.cc

Issue 16950027: Move ComputeDirectorySize to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « base/file_util.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) 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 "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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 int64 size_f2 = 0; 329 int64 size_f2 = 0;
330 ASSERT_TRUE(file_util::GetFileSize(file_02, &size_f2)); 330 ASSERT_TRUE(file_util::GetFileSize(file_02, &size_f2));
331 EXPECT_EQ(30ll, size_f2); 331 EXPECT_EQ(30ll, size_f2);
332 332
333 FilePath subsubdir_path = subdir_path.Append(FPL("Level3")); 333 FilePath subsubdir_path = subdir_path.Append(FPL("Level3"));
334 file_util::CreateDirectory(subsubdir_path); 334 file_util::CreateDirectory(subsubdir_path);
335 335
336 FilePath file_03 = subsubdir_path.Append(FPL("The file 03.txt")); 336 FilePath file_03 = subsubdir_path.Append(FPL("The file 03.txt"));
337 CreateTextFile(file_03, L"123"); 337 CreateTextFile(file_03, L"123");
338 338
339 int64 computed_size = file_util::ComputeDirectorySize(temp_dir_.path()); 339 int64 computed_size = base::ComputeDirectorySize(temp_dir_.path());
tfarina 2013/06/21 23:30:47 to make our lives easier in a future CL we can wra
340 EXPECT_EQ(size_f1 + size_f2 + 3, computed_size); 340 EXPECT_EQ(size_f1 + size_f2 + 3, computed_size);
341 } 341 }
342 342
343 TEST_F(FileUtilTest, NormalizeFilePathBasic) { 343 TEST_F(FileUtilTest, NormalizeFilePathBasic) {
344 // Create a directory under the test dir. Because we create it, 344 // Create a directory under the test dir. Because we create it,
345 // we know it is not a link. 345 // we know it is not a link.
346 FilePath file_a_path = temp_dir_.path().Append(FPL("file_a")); 346 FilePath file_a_path = temp_dir_.path().Append(FPL("file_a"));
347 FilePath dir_path = temp_dir_.path().Append(FPL("dir")); 347 FilePath dir_path = temp_dir_.path().Append(FPL("dir"));
348 FilePath file_b_path = dir_path.Append(FPL("file_b")); 348 FilePath file_b_path = dir_path.Append(FPL("file_b"));
349 file_util::CreateDirectory(dir_path); 349 file_util::CreateDirectory(dir_path);
(...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after
2376 file_util::VerifyPathControlledByUser( 2376 file_util::VerifyPathControlledByUser(
2377 base_dir_, text_file_, uid_, ok_gids_)); 2377 base_dir_, text_file_, uid_, ok_gids_));
2378 EXPECT_TRUE( 2378 EXPECT_TRUE(
2379 file_util::VerifyPathControlledByUser( 2379 file_util::VerifyPathControlledByUser(
2380 sub_dir_, text_file_, uid_, ok_gids_)); 2380 sub_dir_, text_file_, uid_, ok_gids_));
2381 } 2381 }
2382 2382
2383 #endif // defined(OS_POSIX) 2383 #endif // defined(OS_POSIX)
2384 2384
2385 } // namespace 2385 } // namespace
OLDNEW
« no previous file with comments | « base/file_util.cc ('k') | base/file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698