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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
17 #include "base/test/test_timeouts.h" | 17 #include "base/test/test_timeouts.h" |
18 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
21 #include "chrome/browser/google/google_url_tracker.h" | 22 #include "chrome/browser/google/google_url_tracker.h" |
22 #include "chrome/browser/lifetime/application_lifetime.h" | 23 #include "chrome/browser/lifetime/application_lifetime.h" |
23 #include "chrome/browser/password_manager/encryptor.h" | 24 #include "chrome/browser/password_manager/encryptor.h" |
24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
26 #include "chrome/browser/search_engines/template_url_service.h" | 27 #include "chrome/browser/search_engines/template_url_service.h" |
27 #include "chrome/browser/search_engines/template_url_service_factory.h" | 28 #include "chrome/browser/search_engines/template_url_service_factory.h" |
28 #include "chrome/browser/sync/profile_sync_service_factory.h" | 29 #include "chrome/browser/sync/profile_sync_service_factory.h" |
29 #include "chrome/browser/sync/profile_sync_service_harness.h" | 30 #include "chrome/browser/sync/profile_sync_service_harness.h" |
30 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 31 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 EXPECT_FALSE(GetBrowser(index) == NULL) << "Could not create Browser " | 286 EXPECT_FALSE(GetBrowser(index) == NULL) << "Could not create Browser " |
286 << index << "."; | 287 << index << "."; |
287 | 288 |
288 clients_[index] = new ProfileSyncServiceHarness(GetProfile(index), | 289 clients_[index] = new ProfileSyncServiceHarness(GetProfile(index), |
289 username_, | 290 username_, |
290 password_); | 291 password_); |
291 EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " | 292 EXPECT_FALSE(GetClient(index) == NULL) << "Could not create Client " |
292 << index << "."; | 293 << index << "."; |
293 | 294 |
294 ui_test_utils::WaitForBookmarkModelToLoad( | 295 ui_test_utils::WaitForBookmarkModelToLoad( |
295 GetProfile(index)->GetBookmarkModel()); | 296 BookmarkModelFactory::GetForProfile(GetProfile(index))); |
296 | 297 |
297 ui_test_utils::WaitForTemplateURLServiceToLoad( | 298 ui_test_utils::WaitForTemplateURLServiceToLoad( |
298 TemplateURLServiceFactory::GetForProfile(GetProfile(index))); | 299 TemplateURLServiceFactory::GetForProfile(GetProfile(index))); |
299 } | 300 } |
300 | 301 |
301 void SyncTest::RestartSyncService(int index) { | 302 void SyncTest::RestartSyncService(int index) { |
302 DVLOG(1) << "Restarting profile sync service for profile " << index << "."; | 303 DVLOG(1) << "Restarting profile sync service for profile " << index << "."; |
303 delete clients_[index]; | 304 delete clients_[index]; |
304 Profile* profile = GetProfile(index); | 305 Profile* profile = GetProfile(index); |
305 ProfileSyncService* service = | 306 ProfileSyncService* service = |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 786 |
786 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 787 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
787 const net::ProxyConfig& proxy_config) { | 788 const net::ProxyConfig& proxy_config) { |
788 base::WaitableEvent done(false, false); | 789 base::WaitableEvent done(false, false); |
789 BrowserThread::PostTask( | 790 BrowserThread::PostTask( |
790 BrowserThread::IO, FROM_HERE, | 791 BrowserThread::IO, FROM_HERE, |
791 base::Bind(&SetProxyConfigCallback, &done, | 792 base::Bind(&SetProxyConfigCallback, &done, |
792 make_scoped_refptr(context_getter), proxy_config)); | 793 make_scoped_refptr(context_getter), proxy_config)); |
793 done.Wait(); | 794 done.Wait(); |
794 } | 795 } |
OLD | NEW |