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

Side by Side Diff: chrome/test/automation/proxy_launcher.cc

Issue 18332014: Move Copy* into the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windows Created 7 years, 5 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
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 "chrome/test/automation/proxy_launcher.h" 5 #include "chrome/test/automation/proxy_launcher.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // This also kicks the files out of the memory cache for the startup tests. 48 // This also kicks the files out of the memory cache for the startup tests.
49 // TODO(brettw) bug 237904: This is the wrong place for this code. It means all 49 // TODO(brettw) bug 237904: This is the wrong place for this code. It means all
50 // startup tests other than the "cold" ones run more slowly than necessary. 50 // startup tests other than the "cold" ones run more slowly than necessary.
51 bool CopyDirectoryContentsNoCache(const base::FilePath& source, 51 bool CopyDirectoryContentsNoCache(const base::FilePath& source,
52 const base::FilePath& dest) { 52 const base::FilePath& dest) {
53 base::FileEnumerator en(source, false, 53 base::FileEnumerator en(source, false,
54 base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES); 54 base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
55 for (base::FilePath cur = en.Next(); !cur.empty(); cur = en.Next()) { 55 for (base::FilePath cur = en.Next(); !cur.empty(); cur = en.Next()) {
56 base::FileEnumerator::FileInfo info = en.GetInfo(); 56 base::FileEnumerator::FileInfo info = en.GetInfo();
57 if (info.IsDirectory()) { 57 if (info.IsDirectory()) {
58 if (!file_util::CopyDirectory(cur, dest, true)) 58 if (!base::CopyDirectory(cur, dest, true))
59 return false; 59 return false;
60 } else { 60 } else {
61 if (!file_util::CopyFile(cur, dest.Append(cur.BaseName()))) 61 if (!base::CopyFile(cur, dest.Append(cur.BaseName())))
62 return false; 62 return false;
63 } 63 }
64 } 64 }
65 65
66 // Kick out the profile files, this must happen after SetUp which creates the 66 // Kick out the profile files, this must happen after SetUp which creates the
67 // profile. It might be nicer to use EvictFileFromSystemCacheWrapper from 67 // profile. It might be nicer to use EvictFileFromSystemCacheWrapper from
68 // UITest which will retry on failure. 68 // UITest which will retry on failure.
69 base::FileEnumerator kickout(dest, true, base::FileEnumerator::FILES); 69 base::FileEnumerator kickout(dest, true, base::FileEnumerator::FILES);
70 for (base::FilePath cur = kickout.Next(); !cur.empty(); cur = kickout.Next()) 70 for (base::FilePath cur = kickout.Next(); !cur.empty(); cur = kickout.Next())
71 base::EvictFileFromSystemCacheWithRetry(cur); 71 base::EvictFileFromSystemCacheWithRetry(cur);
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 return LaunchBrowserAndServer(state, wait_for_initial_loads); 628 return LaunchBrowserAndServer(state, wait_for_initial_loads);
629 } 629 }
630 630
631 void AnonymousProxyLauncher::TerminateConnection() { 631 void AnonymousProxyLauncher::TerminateConnection() {
632 CloseBrowserAndServer(); 632 CloseBrowserAndServer();
633 } 633 }
634 634
635 std::string AnonymousProxyLauncher::PrefixedChannelID() const { 635 std::string AnonymousProxyLauncher::PrefixedChannelID() const {
636 return channel_id_; 636 return channel_id_;
637 } 637 }
OLDNEW
« no previous file with comments | « chrome/installer/util/move_tree_work_item_unittest.cc ('k') | chrome/test/mini_installer_test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698