| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "net/proxy/proxy_service.h" | 48 #include "net/proxy/proxy_service.h" |
| 49 #include "net/test/test_server.h" | 49 #include "net/test/test_server.h" |
| 50 #include "net/url_request/test_url_fetcher_factory.h" | 50 #include "net/url_request/test_url_fetcher_factory.h" |
| 51 #include "net/url_request/url_fetcher.h" | 51 #include "net/url_request/url_fetcher.h" |
| 52 #include "net/url_request/url_fetcher_delegate.h" | 52 #include "net/url_request/url_fetcher_delegate.h" |
| 53 #include "net/url_request/url_request_context.h" | 53 #include "net/url_request/url_request_context.h" |
| 54 #include "net/url_request/url_request_context_getter.h" | 54 #include "net/url_request/url_request_context_getter.h" |
| 55 #include "net/url_request/url_request_status.h" | 55 #include "net/url_request/url_request_status.h" |
| 56 #include "sync/notifier/p2p_notifier.h" | 56 #include "sync/notifier/p2p_notifier.h" |
| 57 #include "sync/protocol/sync.pb.h" | 57 #include "sync/protocol/sync.pb.h" |
| 58 #include "sync/engine/sync_scheduler_impl.h" |
| 58 | 59 |
| 59 using content::BrowserThread; | 60 using content::BrowserThread; |
| 60 | 61 |
| 61 namespace switches { | 62 namespace switches { |
| 62 const char kPasswordFileForTest[] = "password-file-for-test"; | 63 const char kPasswordFileForTest[] = "password-file-for-test"; |
| 63 const char kSyncUserForTest[] = "sync-user-for-test"; | 64 const char kSyncUserForTest[] = "sync-user-for-test"; |
| 64 const char kSyncPasswordForTest[] = "sync-password-for-test"; | 65 const char kSyncPasswordForTest[] = "sync-password-for-test"; |
| 65 const char kSyncServerCommandLine[] = "sync-server-command-line"; | 66 const char kSyncServerCommandLine[] = "sync-server-command-line"; |
| 66 } | 67 } |
| 67 | 68 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 163 } |
| 163 | 164 |
| 164 if (username_.empty() || password_.empty()) | 165 if (username_.empty() || password_.empty()) |
| 165 LOG(FATAL) << "Cannot run sync tests without GAIA credentials."; | 166 LOG(FATAL) << "Cannot run sync tests without GAIA credentials."; |
| 166 | 167 |
| 167 // Mock the Mac Keychain service. The real Keychain can block on user input. | 168 // Mock the Mac Keychain service. The real Keychain can block on user input. |
| 168 #if defined(OS_MACOSX) | 169 #if defined(OS_MACOSX) |
| 169 Encryptor::UseMockKeychain(true); | 170 Encryptor::UseMockKeychain(true); |
| 170 #endif | 171 #endif |
| 171 | 172 |
| 173 // TODO(tim): Use command line flag. |
| 174 syncer::SyncSchedulerImpl::ForceShortInitialBackoffRetry(); |
| 175 |
| 172 // Yield control back to the InProcessBrowserTest framework. | 176 // Yield control back to the InProcessBrowserTest framework. |
| 173 InProcessBrowserTest::SetUp(); | 177 InProcessBrowserTest::SetUp(); |
| 174 } | 178 } |
| 175 | 179 |
| 176 void SyncTest::TearDown() { | 180 void SyncTest::TearDown() { |
| 177 // Allow the InProcessBrowserTest framework to perform its tear down. | 181 // Allow the InProcessBrowserTest framework to perform its tear down. |
| 178 InProcessBrowserTest::TearDown(); | 182 InProcessBrowserTest::TearDown(); |
| 179 | 183 |
| 180 // Stop the local python test server. This is a no-op if one wasn't started. | 184 // Stop the local python test server. This is a no-op if one wasn't started. |
| 181 TearDownLocalPythonTestServer(); | 185 TearDownLocalPythonTestServer(); |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 | 795 |
| 792 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 796 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 793 const net::ProxyConfig& proxy_config) { | 797 const net::ProxyConfig& proxy_config) { |
| 794 base::WaitableEvent done(false, false); | 798 base::WaitableEvent done(false, false); |
| 795 BrowserThread::PostTask( | 799 BrowserThread::PostTask( |
| 796 BrowserThread::IO, FROM_HERE, | 800 BrowserThread::IO, FROM_HERE, |
| 797 base::Bind(&SetProxyConfigCallback, &done, | 801 base::Bind(&SetProxyConfigCallback, &done, |
| 798 make_scoped_refptr(context_getter), proxy_config)); | 802 make_scoped_refptr(context_getter), proxy_config)); |
| 799 done.Wait(); | 803 done.Wait(); |
| 800 } | 804 } |
| OLD | NEW |