| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 if (username_.empty() || password_.empty()) | 165 if (username_.empty() || password_.empty()) |
| 166 LOG(FATAL) << "Cannot run sync tests without GAIA credentials."; | 166 LOG(FATAL) << "Cannot run sync tests without GAIA credentials."; |
| 167 | 167 |
| 168 // 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. |
| 169 #if defined(OS_MACOSX) | 169 #if defined(OS_MACOSX) |
| 170 Encryptor::UseMockKeychain(true); | 170 Encryptor::UseMockKeychain(true); |
| 171 #endif | 171 #endif |
| 172 | 172 |
| 173 // TODO(tim): Use command line flag. | |
| 174 syncer::SyncSchedulerImpl::ForceShortInitialBackoffRetry(); | |
| 175 | |
| 176 // Yield control back to the InProcessBrowserTest framework. | 173 // Yield control back to the InProcessBrowserTest framework. |
| 177 InProcessBrowserTest::SetUp(); | 174 InProcessBrowserTest::SetUp(); |
| 178 } | 175 } |
| 179 | 176 |
| 180 void SyncTest::TearDown() { | 177 void SyncTest::TearDown() { |
| 181 // Allow the InProcessBrowserTest framework to perform its tear down. | 178 // Allow the InProcessBrowserTest framework to perform its tear down. |
| 182 InProcessBrowserTest::TearDown(); | 179 InProcessBrowserTest::TearDown(); |
| 183 | 180 |
| 184 // Stop the local python test server. This is a no-op if one wasn't started. | 181 // Stop the local python test server. This is a no-op if one wasn't started. |
| 185 TearDownLocalPythonTestServer(); | 182 TearDownLocalPythonTestServer(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 199 if (!cl->HasSwitch(switches::kSyncNotificationMethod)) | 196 if (!cl->HasSwitch(switches::kSyncNotificationMethod)) |
| 200 cl->AppendSwitchASCII(switches::kSyncNotificationMethod, "p2p"); | 197 cl->AppendSwitchASCII(switches::kSyncNotificationMethod, "p2p"); |
| 201 | 198 |
| 202 // Disable non-essential access of external network resources. | 199 // Disable non-essential access of external network resources. |
| 203 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) | 200 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) |
| 204 cl->AppendSwitch(switches::kDisableBackgroundNetworking); | 201 cl->AppendSwitch(switches::kDisableBackgroundNetworking); |
| 205 | 202 |
| 206 // TODO(sync): remove this once keystore encryption is enabled by default. | 203 // TODO(sync): remove this once keystore encryption is enabled by default. |
| 207 if (!cl->HasSwitch(switches::kSyncKeystoreEncryption)) | 204 if (!cl->HasSwitch(switches::kSyncKeystoreEncryption)) |
| 208 cl->AppendSwitch(switches::kSyncKeystoreEncryption); | 205 cl->AppendSwitch(switches::kSyncKeystoreEncryption); |
| 206 |
| 207 if (!cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) |
| 208 cl->AppendSwitch(switches::kSyncShortInitialRetryOverride); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void SyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) {} | 211 void SyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) {} |
| 212 | 212 |
| 213 // static | 213 // static |
| 214 Profile* SyncTest::MakeProfile(const FilePath::StringType name) { | 214 Profile* SyncTest::MakeProfile(const FilePath::StringType name) { |
| 215 FilePath path; | 215 FilePath path; |
| 216 PathService::Get(chrome::DIR_USER_DATA, &path); | 216 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 217 path = path.Append(name); | 217 path = path.Append(name); |
| 218 | 218 |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 | 795 |
| 796 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 796 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 797 const net::ProxyConfig& proxy_config) { | 797 const net::ProxyConfig& proxy_config) { |
| 798 base::WaitableEvent done(false, false); | 798 base::WaitableEvent done(false, false); |
| 799 BrowserThread::PostTask( | 799 BrowserThread::PostTask( |
| 800 BrowserThread::IO, FROM_HERE, | 800 BrowserThread::IO, FROM_HERE, |
| 801 base::Bind(&SetProxyConfigCallback, &done, | 801 base::Bind(&SetProxyConfigCallback, &done, |
| 802 make_scoped_refptr(context_getter), proxy_config)); | 802 make_scoped_refptr(context_getter), proxy_config)); |
| 803 done.Wait(); | 803 done.Wait(); |
| 804 } | 804 } |
| OLD | NEW |