OLD | NEW |
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 if (!test_launcher_utils::OverrideUserDataDir(user_data_dir())) { | 181 if (!test_launcher_utils::OverrideUserDataDir(user_data_dir())) { |
182 LOG(ERROR) << "Failed to override user data directory."; | 182 LOG(ERROR) << "Failed to override user data directory."; |
183 return false; | 183 return false; |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 if (!state.template_user_data.empty()) { | 187 if (!state.template_user_data.empty()) { |
188 // Recursively copy the template directory to the user_data_dir. | 188 // Recursively copy the template directory to the user_data_dir. |
189 if (!file_util::CopyRecursiveDirNoCache( | 189 if (!file_util::CopyDirectory(state.template_user_data, user_data_dir(), |
190 state.template_user_data, user_data_dir())) { | 190 true)) { |
191 LOG(ERROR) << "Failed to copy user data directory template."; | 191 LOG(ERROR) << "Failed to copy user data directory template."; |
192 return false; | 192 return false; |
193 } | 193 } |
194 | 194 |
195 // Update the history file to include recent dates. | 195 // Update the history file to include recent dates. |
196 UpdateHistoryDates(user_data_dir()); | 196 UpdateHistoryDates(user_data_dir()); |
197 } | 197 } |
198 | 198 |
199 // Optionally do any final setup of the test environment. | 199 // Optionally do any final setup of the test environment. |
200 if (!state.setup_profile_callback.is_null()) | 200 if (!state.setup_profile_callback.is_null()) |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 return LaunchBrowserAndServer(state, wait_for_initial_loads); | 593 return LaunchBrowserAndServer(state, wait_for_initial_loads); |
594 } | 594 } |
595 | 595 |
596 void AnonymousProxyLauncher::TerminateConnection() { | 596 void AnonymousProxyLauncher::TerminateConnection() { |
597 CloseBrowserAndServer(); | 597 CloseBrowserAndServer(); |
598 } | 598 } |
599 | 599 |
600 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | 600 std::string AnonymousProxyLauncher::PrefixedChannelID() const { |
601 return channel_id_; | 601 return channel_id_; |
602 } | 602 } |
OLD | NEW |