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

Side by Side Diff: net/disk_cache/block_files_unittest.cc

Issue 13165005: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge, fixes Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/base/directory_lister_unittest.cc ('k') | net/disk_cache/cache_util_posix.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/file_util.h" 5 #include "base/file_util.h"
6 #include "base/files/file_enumerator.h"
6 #include "net/disk_cache/block_files.h" 7 #include "net/disk_cache/block_files.h"
7 #include "net/disk_cache/disk_cache.h" 8 #include "net/disk_cache/disk_cache.h"
8 #include "net/disk_cache/disk_cache_test_base.h" 9 #include "net/disk_cache/disk_cache_test_base.h"
9 #include "net/disk_cache/disk_cache_test_util.h" 10 #include "net/disk_cache/disk_cache_test_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 12
12 using base::Time; 13 using base::Time;
13 14
14 namespace { 15 namespace {
15 16
16 // Returns the number of files in this folder. 17 // Returns the number of files in this folder.
17 int NumberOfFiles(const base::FilePath& path) { 18 int NumberOfFiles(const base::FilePath& path) {
18 file_util::FileEnumerator iter(path, false, file_util::FileEnumerator::FILES); 19 base::FileEnumerator iter(path, false, base::FileEnumerator::FILES);
19 int count = 0; 20 int count = 0;
20 for (base::FilePath file = iter.Next(); !file.value().empty(); 21 for (base::FilePath file = iter.Next(); !file.value().empty();
21 file = iter.Next()) { 22 file = iter.Next()) {
22 count++; 23 count++;
23 } 24 }
24 return count; 25 return count;
25 } 26 }
26 27
27 } // namespace; 28 } // namespace;
28 29
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 341 }
341 342
342 // The allocation map should be empty. 343 // The allocation map should be empty.
343 for (int i =0; i < 50; i++) { 344 for (int i =0; i < 50; i++) {
344 SCOPED_TRACE(i); 345 SCOPED_TRACE(i);
345 EXPECT_EQ(0, buffer[i]); 346 EXPECT_EQ(0, buffer[i]);
346 } 347 }
347 } 348 }
348 349
349 } // namespace disk_cache 350 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/base/directory_lister_unittest.cc ('k') | net/disk_cache/cache_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698