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/google/google_url_tracker.h" | 21 #include "chrome/browser/google/google_url_tracker.h" |
| 22 #include "chrome/browser/lifetime/application_lifetime.h" |
22 #include "chrome/browser/password_manager/encryptor.h" | 23 #include "chrome/browser/password_manager/encryptor.h" |
23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
25 #include "chrome/browser/search_engines/template_url_service.h" | 26 #include "chrome/browser/search_engines/template_url_service.h" |
26 #include "chrome/browser/search_engines/template_url_service_factory.h" | 27 #include "chrome/browser/search_engines/template_url_service_factory.h" |
27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 28 #include "chrome/browser/sync/profile_sync_service_factory.h" |
28 #include "chrome/browser/sync/profile_sync_service_harness.h" | 29 #include "chrome/browser/sync/profile_sync_service_harness.h" |
29 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 30 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
30 #include "chrome/browser/ui/browser.h" | 31 #include "chrome/browser/ui/browser.h" |
31 #include "chrome/browser/ui/browser_list.h" | 32 #include "chrome/browser/ui/browser_list.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 number_of_default_sync_items_ = GetClient(0)->GetNumEntries() - | 343 number_of_default_sync_items_ = GetClient(0)->GetNumEntries() - |
343 GetClient(0)->GetNumDatatypes() - 7; | 344 GetClient(0)->GetNumDatatypes() - 7; |
344 DVLOG(1) << "Setting " << number_of_default_sync_items_ << " as default " | 345 DVLOG(1) << "Setting " << number_of_default_sync_items_ << " as default " |
345 << " number of entries."; | 346 << " number of entries."; |
346 | 347 |
347 return true; | 348 return true; |
348 } | 349 } |
349 | 350 |
350 void SyncTest::CleanUpOnMainThread() { | 351 void SyncTest::CleanUpOnMainThread() { |
351 // Close all browser windows. | 352 // Close all browser windows. |
352 BrowserList::CloseAllBrowsers(); | 353 browser::CloseAllBrowsers(); |
353 ui_test_utils::RunAllPendingInMessageLoop(); | 354 ui_test_utils::RunAllPendingInMessageLoop(); |
354 | 355 |
355 // All browsers should be closed at this point, or else we could see memory | 356 // All browsers should be closed at this point, or else we could see memory |
356 // corruption in QuitBrowser(). | 357 // corruption in QuitBrowser(). |
357 CHECK_EQ(0U, BrowserList::size()); | 358 CHECK_EQ(0U, BrowserList::size()); |
358 clients_.reset(); | 359 clients_.reset(); |
359 } | 360 } |
360 | 361 |
361 void SyncTest::SetUpInProcessBrowserTestFixture() { | 362 void SyncTest::SetUpInProcessBrowserTestFixture() { |
362 // We don't take a reference to |resolver|, but mock_host_resolver_override_ | 363 // We don't take a reference to |resolver|, but mock_host_resolver_override_ |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 | 787 |
787 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 788 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
788 const net::ProxyConfig& proxy_config) { | 789 const net::ProxyConfig& proxy_config) { |
789 base::WaitableEvent done(false, false); | 790 base::WaitableEvent done(false, false); |
790 BrowserThread::PostTask( | 791 BrowserThread::PostTask( |
791 BrowserThread::IO, FROM_HERE, | 792 BrowserThread::IO, FROM_HERE, |
792 base::Bind(&SetProxyConfigCallback, &done, | 793 base::Bind(&SetProxyConfigCallback, &done, |
793 make_scoped_refptr(context_getter), proxy_config)); | 794 make_scoped_refptr(context_getter), proxy_config)); |
794 done.Wait(); | 795 done.Wait(); |
795 } | 796 } |
OLD | NEW |