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 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/lifetime/application_lifetime.h" | 24 #include "chrome/browser/lifetime/application_lifetime.h" |
25 #include "chrome/browser/password_manager/encryptor.h" | 25 #include "chrome/browser/password_manager/encryptor.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/profiles/profile_manager.h" | 27 #include "chrome/browser/profiles/profile_manager.h" |
28 #include "chrome/browser/search_engines/template_url_service.h" | 28 #include "chrome/browser/search_engines/template_url_service.h" |
29 #include "chrome/browser/search_engines/template_url_service_factory.h" | 29 #include "chrome/browser/search_engines/template_url_service_factory.h" |
30 #include "chrome/browser/sync/profile_sync_service_factory.h" | 30 #include "chrome/browser/sync/profile_sync_service_factory.h" |
31 #include "chrome/browser/sync/profile_sync_service_harness.h" | 31 #include "chrome/browser/sync/profile_sync_service_harness.h" |
32 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 32 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
33 #include "chrome/browser/ui/browser.h" | 33 #include "chrome/browser/ui/browser.h" |
34 #include "chrome/browser/ui/browser_list.h" | 34 #include "chrome/browser/ui/browser_finder.h" |
35 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 35 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
36 #include "chrome/common/chrome_paths.h" | 36 #include "chrome/common/chrome_paths.h" |
37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/test/base/testing_browser_process.h" | 38 #include "chrome/test/base/testing_browser_process.h" |
39 #include "chrome/test/base/ui_test_utils.h" | 39 #include "chrome/test/base/ui_test_utils.h" |
40 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
41 #include "content/public/test/test_browser_thread.h" | 41 #include "content/public/test/test_browser_thread.h" |
42 #include "google_apis/gaia/gaia_urls.h" | 42 #include "google_apis/gaia/gaia_urls.h" |
43 #include "googleurl/src/gurl.h" | 43 #include "googleurl/src/gurl.h" |
44 #include "net/base/escape.h" | 44 #include "net/base/escape.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 void SyncTest::CleanUpOnMainThread() { | 367 void SyncTest::CleanUpOnMainThread() { |
368 // Some of the pending messages might rely on browser windows still being | 368 // Some of the pending messages might rely on browser windows still being |
369 // around, so run messages both before and after closing all browsers. | 369 // around, so run messages both before and after closing all browsers. |
370 content::RunAllPendingInMessageLoop(); | 370 content::RunAllPendingInMessageLoop(); |
371 // Close all browser windows. | 371 // Close all browser windows. |
372 browser::CloseAllBrowsers(); | 372 browser::CloseAllBrowsers(); |
373 content::RunAllPendingInMessageLoop(); | 373 content::RunAllPendingInMessageLoop(); |
374 | 374 |
375 // All browsers should be closed at this point, or else we could see memory | 375 // All browsers should be closed at this point, or else we could see memory |
376 // corruption in QuitBrowser(). | 376 // corruption in QuitBrowser(). |
377 CHECK_EQ(0U, BrowserList::size()); | 377 CHECK_EQ(0U, chrome::GetTotalBrowserCount()); |
378 clients_.clear(); | 378 clients_.clear(); |
379 } | 379 } |
380 | 380 |
381 void SyncTest::SetUpInProcessBrowserTestFixture() { | 381 void SyncTest::SetUpInProcessBrowserTestFixture() { |
382 // We don't take a reference to |resolver|, but mock_host_resolver_override_ | 382 // We don't take a reference to |resolver|, but mock_host_resolver_override_ |
383 // does, so effectively assumes ownership. | 383 // does, so effectively assumes ownership. |
384 net::RuleBasedHostResolverProc* resolver = | 384 net::RuleBasedHostResolverProc* resolver = |
385 new net::RuleBasedHostResolverProc(host_resolver()); | 385 new net::RuleBasedHostResolverProc(host_resolver()); |
386 resolver->AllowDirectLookup("*.google.com"); | 386 resolver->AllowDirectLookup("*.google.com"); |
387 // On Linux, we use Chromium's NSS implementation which uses the following | 387 // On Linux, we use Chromium's NSS implementation which uses the following |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 839 |
840 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 840 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
841 const net::ProxyConfig& proxy_config) { | 841 const net::ProxyConfig& proxy_config) { |
842 base::WaitableEvent done(false, false); | 842 base::WaitableEvent done(false, false); |
843 BrowserThread::PostTask( | 843 BrowserThread::PostTask( |
844 BrowserThread::IO, FROM_HERE, | 844 BrowserThread::IO, FROM_HERE, |
845 base::Bind(&SetProxyConfigCallback, &done, | 845 base::Bind(&SetProxyConfigCallback, &done, |
846 make_scoped_refptr(context_getter), proxy_config)); | 846 make_scoped_refptr(context_getter), proxy_config)); |
847 done.Wait(); | 847 done.Wait(); |
848 } | 848 } |
OLD | NEW |