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/browser/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Profile* SyncTest::MakeProfile(const base::FilePath::StringType name) { | 224 Profile* SyncTest::MakeProfile(const base::FilePath::StringType name) { |
225 base::FilePath path; | 225 base::FilePath path; |
226 PathService::Get(chrome::DIR_USER_DATA, &path); | 226 PathService::Get(chrome::DIR_USER_DATA, &path); |
227 path = path.Append(name); | 227 path = path.Append(name); |
228 | 228 |
229 if (!file_util::PathExists(path)) | 229 if (!file_util::PathExists(path)) |
230 CHECK(file_util::CreateDirectory(path)); | 230 CHECK(file_util::CreateDirectory(path)); |
231 | 231 |
232 Profile* profile = | 232 Profile* profile = |
233 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); | 233 Profile::CreateProfile(path, NULL, Profile::CREATE_MODE_SYNCHRONOUS); |
234 g_browser_process->profile_manager()->RegisterTestingProfile(profile, true); | 234 g_browser_process->profile_manager()->RegisterTestingProfile(profile, |
| 235 true, |
| 236 true); |
235 return profile; | 237 return profile; |
236 } | 238 } |
237 | 239 |
238 Profile* SyncTest::GetProfile(int index) { | 240 Profile* SyncTest::GetProfile(int index) { |
239 if (profiles_.empty()) | 241 if (profiles_.empty()) |
240 LOG(FATAL) << "SetupClients() has not yet been called."; | 242 LOG(FATAL) << "SetupClients() has not yet been called."; |
241 if (index < 0 || index >= static_cast<int>(profiles_.size())) | 243 if (index < 0 || index >= static_cast<int>(profiles_.size())) |
242 LOG(FATAL) << "GetProfile(): Index is out of bounds."; | 244 LOG(FATAL) << "GetProfile(): Index is out of bounds."; |
243 return profiles_[index]; | 245 return profiles_[index]; |
244 } | 246 } |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 | 848 |
847 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 849 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
848 const net::ProxyConfig& proxy_config) { | 850 const net::ProxyConfig& proxy_config) { |
849 base::WaitableEvent done(false, false); | 851 base::WaitableEvent done(false, false); |
850 BrowserThread::PostTask( | 852 BrowserThread::PostTask( |
851 BrowserThread::IO, FROM_HERE, | 853 BrowserThread::IO, FROM_HERE, |
852 base::Bind(&SetProxyConfigCallback, &done, | 854 base::Bind(&SetProxyConfigCallback, &done, |
853 make_scoped_refptr(context_getter), proxy_config)); | 855 make_scoped_refptr(context_getter), proxy_config)); |
854 done.Wait(); | 856 done.Wait(); |
855 } | 857 } |
OLD | NEW |