diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 04:53:36 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 04:53:36 +0000 |
commit | 25a4c1ccaee2b032ee368d733b79ac814efd7c37 (patch) | |
tree | 589cd0233167acf4a3fe7bdaf50cea24ad505b7b /chrome/test/automation | |
parent | aff39ac8a8ea09920b9180ebc09d72c15832f3ad (diff) | |
download | chromium_src-25a4c1ccaee2b032ee368d733b79ac814efd7c37.zip chromium_src-25a4c1ccaee2b032ee368d733b79ac814efd7c37.tar.gz chromium_src-25a4c1ccaee2b032ee368d733b79ac814efd7c37.tar.bz2 |
Move FileEnumerator to its own file, do some refactoring.
It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked.
BUG=175002
Reland of 198820 and 298824
Original review = https://codereview.chromium.org/13165005
R=rvargas@chromium.org
Review URL: https://codereview.chromium.org/16392011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r-- | chrome/test/automation/proxy_launcher.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 49c129f..15b12e7 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -8,6 +8,7 @@ #include "base/environment.h" #include "base/file_util.h" +#include "base/files/file_enumerator.h" #include "base/stringprintf.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" @@ -49,13 +50,11 @@ const char kUITestType[] = "ui"; // startup tests other than the "cold" ones run more slowly than necessary. bool CopyDirectoryContentsNoCache(const base::FilePath& source, const base::FilePath& dest) { - file_util::FileEnumerator en(source, false, - file_util::FileEnumerator::FILES | - file_util::FileEnumerator::DIRECTORIES); + base::FileEnumerator en(source, false, + base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES); for (base::FilePath cur = en.Next(); !cur.empty(); cur = en.Next()) { - file_util::FileEnumerator::FindInfo info; - en.GetFindInfo(&info); - if (file_util::FileEnumerator::IsDirectory(info)) { + base::FileEnumerator::FileInfo info = en.GetInfo(); + if (info.IsDirectory()) { if (!file_util::CopyDirectory(cur, dest, true)) return false; } else { @@ -67,8 +66,7 @@ bool CopyDirectoryContentsNoCache(const base::FilePath& source, // Kick out the profile files, this must happen after SetUp which creates the // profile. It might be nicer to use EvictFileFromSystemCacheWrapper from // UITest which will retry on failure. - file_util::FileEnumerator kickout(dest, true, - file_util::FileEnumerator::FILES); + base::FileEnumerator kickout(dest, true, base::FileEnumerator::FILES); for (base::FilePath cur = kickout.Next(); !cur.empty(); cur = kickout.Next()) base::EvictFileFromSystemCacheWithRetry(cur); return true; |