diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 19:58:09 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 19:58:09 +0000 |
commit | 715fe2473792264b86294357d7f783a43c7961f1 (patch) | |
tree | 9bf76ab4e838efbd50480474ed4b0ce382d85814 /chrome/test/automation | |
parent | 17c4ce62ff8cff51f81c0cd79622a095754695bb (diff) | |
download | chromium_src-715fe2473792264b86294357d7f783a43c7961f1.zip chromium_src-715fe2473792264b86294357d7f783a43c7961f1.tar.gz chromium_src-715fe2473792264b86294357d7f783a43c7961f1.tar.bz2 |
Revert 194664 "Delete CopyRecursiveDirNoCache from test_file_util."
Broke the results of the startup_benchmark on linux.
BUG=237858
> Delete CopyRecursiveDirNoCache from test_file_util.
>
> This function was used in only one place and that place was wrong.
>
> The implementation was long and complicated on Windows, and long and
> complicated and copied verbatim from elsewhere with 3 lines different on Posix.
>
> The place it was used was in the proxy launcher when copying the profile. It's
> not clear to me why we wouldn't want the profile files in the filesystem cache
> when running tests. Quite the opposite, we want the tests to run as fast as
> possible.
>
> The only place this should matter is in the startup tests. And the startup
> tests do things to the profile after it gets copied that should page some files
> back in! This adds another step to the startup tests to evict the profile files
> for cold startup tests only.
>
> This is a reland of r192940 which crashed on Mac. The previous perf startup
> test used the profile directory before it was initialized. That patch was in
> turn a reland r191854 which broke the startup test. The previous patch
> replaced the CopyRecursive call with CopyDirectory which does something
> slightly different. This new patch implements a CopyDirectoryContents function
> to do what's required here.
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/14799003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r-- | chrome/test/automation/proxy_launcher.cc | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 07776c5..6903c60 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -39,29 +39,6 @@ namespace { // Passed as value of kTestType. const char kUITestType[] = "ui"; -// Copies the contents of the given source directory to the given dest -// directory. This is somewhat different than CopyDirectory in base which will -// copies "source/" to "dest/source/". This version will copy "source/*" to -// "dest/*", overwriting existing files as necessary. -bool CopyDirectoryContents(const base::FilePath& source, - const base::FilePath& dest) { - file_util::FileEnumerator en(source, false, - file_util::FileEnumerator::FILES | - file_util::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)) { - if (!file_util::CopyDirectory(cur, dest, true)) - return false; - } else { - if (!file_util::CopyFile(cur, dest.Append(cur.BaseName()))) - return false; - } - } - return true; -} - // We want to have a current history database when we start the browser so // things like the NTP will have thumbnails. This method updates the dates // in the history to be more recent. @@ -207,7 +184,8 @@ bool ProxyLauncher::LaunchBrowser(const LaunchState& state) { if (!state.template_user_data.empty()) { // Recursively copy the template directory to the user_data_dir. - if (!CopyDirectoryContents(state.template_user_data, user_data_dir())) { + if (!file_util::CopyRecursiveDirNoCache( + state.template_user_data, user_data_dir())) { LOG(ERROR) << "Failed to copy user data directory template."; return false; } |