| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Disable non-essential access of external network resources. | 218 // Disable non-essential access of external network resources. |
| 219 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) | 219 if (!cl->HasSwitch(switches::kDisableBackgroundNetworking)) |
| 220 cl->AppendSwitch(switches::kDisableBackgroundNetworking); | 220 cl->AppendSwitch(switches::kDisableBackgroundNetworking); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void SyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) { | 223 void SyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) { |
| 224 // TODO(sync): Remove this once sessions sync is enabled by default. | 224 // TODO(sync): Remove this once sessions sync is enabled by default. |
| 225 if (!cl->HasSwitch(switches::kEnableSyncTabs)) | 225 if (!cl->HasSwitch(switches::kEnableSyncTabs)) |
| 226 cl->AppendSwitch(switches::kEnableSyncTabs); | 226 cl->AppendSwitch(switches::kEnableSyncTabs); |
| 227 | |
| 228 // TODO(stevet): Remove this once search engines sync is enabled by default. | |
| 229 if (!cl->HasSwitch(switches::kEnableSyncSearchEngines)) | |
| 230 cl->AppendSwitch(switches::kEnableSyncSearchEngines); | |
| 231 } | 227 } |
| 232 | 228 |
| 233 // static | 229 // static |
| 234 Profile* SyncTest::MakeProfile(const FilePath::StringType name) { | 230 Profile* SyncTest::MakeProfile(const FilePath::StringType name) { |
| 235 FilePath path; | 231 FilePath path; |
| 236 PathService::Get(chrome::DIR_USER_DATA, &path); | 232 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 237 path = path.Append(name); | 233 path = path.Append(name); |
| 238 | 234 |
| 239 if (!file_util::PathExists(path)) | 235 if (!file_util::PathExists(path)) |
| 240 CHECK(file_util::CreateDirectory(path)); | 236 CHECK(file_util::CreateDirectory(path)); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 } | 692 } |
| 697 | 693 |
| 698 void SyncTest::TriggerSetSyncTabs() { | 694 void SyncTest::TriggerSetSyncTabs() { |
| 699 ASSERT_TRUE(ServerSupportsErrorTriggering()); | 695 ASSERT_TRUE(ServerSupportsErrorTriggering()); |
| 700 std::string path = "chromiumsync/synctabs"; | 696 std::string path = "chromiumsync/synctabs"; |
| 701 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); | 697 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); |
| 702 ASSERT_EQ("Sync Tabs", | 698 ASSERT_EQ("Sync Tabs", |
| 703 UTF16ToASCII(browser()->GetSelectedTabContents()->GetTitle())); | 699 UTF16ToASCII(browser()->GetSelectedTabContents()->GetTitle())); |
| 704 } | 700 } |
| 705 | 701 |
| 702 int SyncTest::NumberOfDefaultSyncItems() const { |
| 703 // Just return the current number of basic sync items that are synced, |
| 704 // including preferences, themes, and search engines. |
| 705 // TODO(stevet): It would be nice if there was some mechanism for retrieving |
| 706 // this sum from each data type without having to manually count and update |
| 707 // this value. |
| 708 return 7; |
| 709 } |
| 710 |
| 706 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 711 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 707 const net::ProxyConfig& proxy_config) { | 712 const net::ProxyConfig& proxy_config) { |
| 708 base::WaitableEvent done(false, false); | 713 base::WaitableEvent done(false, false); |
| 709 BrowserThread::PostTask( | 714 BrowserThread::PostTask( |
| 710 BrowserThread::IO, | 715 BrowserThread::IO, |
| 711 FROM_HERE, | 716 FROM_HERE, |
| 712 new SetProxyConfigTask(&done, | 717 new SetProxyConfigTask(&done, |
| 713 context_getter, | 718 context_getter, |
| 714 proxy_config)); | 719 proxy_config)); |
| 715 done.Wait(); | 720 done.Wait(); |
| 716 } | 721 } |
| OLD | NEW |