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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 void SyncTest::InitializeInstance(int index) { | 294 void SyncTest::InitializeInstance(int index) { |
295 profiles_[index] = MakeProfile( | 295 profiles_[index] = MakeProfile( |
296 base::StringPrintf(FILE_PATH_LITERAL("Profile%d"), index)); | 296 base::StringPrintf(FILE_PATH_LITERAL("Profile%d"), index)); |
297 EXPECT_FALSE(GetProfile(index) == NULL) << "Could not create Profile " | 297 EXPECT_FALSE(GetProfile(index) == NULL) << "Could not create Profile " |
298 << index << "."; | 298 << index << "."; |
299 | 299 |
300 browsers_[index] = new Browser(Browser::CreateParams(GetProfile(index))); | 300 browsers_[index] = new Browser(Browser::CreateParams(GetProfile(index))); |
301 EXPECT_FALSE(GetBrowser(index) == NULL) << "Could not create Browser " | 301 EXPECT_FALSE(GetBrowser(index) == NULL) << "Could not create Browser " |
302 << index << "."; | 302 << index << "."; |
303 | 303 |
| 304 // Make sure the ProfileSyncService has been created before creating the |
| 305 // ProfileSyncServiceHarness - some tests expect the ProfileSyncService to |
| 306 // already exist. |
| 307 ProfileSyncServiceFactory::GetForProfile(GetProfile(index)); |
| 308 |
304 clients_[index] = new ProfileSyncServiceHarness(GetProfile(index), | 309 clients_[index] = new ProfileSyncServiceHarness(GetProfile(index), |
305 username_, | 310 username_, |
306 password_); | 311 password_); |
307 EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " | 312 EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " |
308 << index << "."; | 313 << index << "."; |
309 | 314 |
310 ui_test_utils::WaitForBookmarkModelToLoad( | 315 ui_test_utils::WaitForBookmarkModelToLoad( |
311 BookmarkModelFactory::GetForProfile(GetProfile(index))); | 316 BookmarkModelFactory::GetForProfile(GetProfile(index))); |
312 ui_test_utils::WaitForHistoryToLoad(HistoryServiceFactory::GetForProfile( | 317 ui_test_utils::WaitForHistoryToLoad(HistoryServiceFactory::GetForProfile( |
313 GetProfile(index), Profile::EXPLICIT_ACCESS)); | 318 GetProfile(index), Profile::EXPLICIT_ACCESS)); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 839 |
835 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 840 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
836 const net::ProxyConfig& proxy_config) { | 841 const net::ProxyConfig& proxy_config) { |
837 base::WaitableEvent done(false, false); | 842 base::WaitableEvent done(false, false); |
838 BrowserThread::PostTask( | 843 BrowserThread::PostTask( |
839 BrowserThread::IO, FROM_HERE, | 844 BrowserThread::IO, FROM_HERE, |
840 base::Bind(&SetProxyConfigCallback, &done, | 845 base::Bind(&SetProxyConfigCallback, &done, |
841 make_scoped_refptr(context_getter), proxy_config)); | 846 make_scoped_refptr(context_getter), proxy_config)); |
842 done.Wait(); | 847 done.Wait(); |
843 } | 848 } |
OLD | NEW |