diff options
author | brg@chromium.com <brg@chromium.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 09:11:44 +0000 |
---|---|---|
committer | brg@chromium.com <brg@chromium.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 09:11:44 +0000 |
commit | 345a8b7973e6693d115d20573f7cef17e4525cb3 (patch) | |
tree | 2a77dcf7842d660688a9775569f1adee43a82184 /chrome/test | |
parent | 2c365900efc2d9aeba3df9c7f5afd1e45d9b530d (diff) | |
download | chromium_src-345a8b7973e6693d115d20573f7cef17e4525cb3.zip chromium_src-345a8b7973e6693d115d20573f7cef17e4525cb3.tar.gz chromium_src-345a8b7973e6693d115d20573f7cef17e4525cb3.tar.bz2 |
Remove the enable-sync flag from the Chrome command line and enable sync by default.
BUG=none
Test=Sync my bookmarks should be enabled by default.
Review URL: http://codereview.chromium.org/248024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/live_sync/live_bookmarks_sync_test.h | 1 | ||||
-rw-r--r-- | chrome/test/testing_profile.cc | 17 | ||||
-rw-r--r-- | chrome/test/testing_profile.h | 11 |
3 files changed, 25 insertions, 4 deletions
diff --git a/chrome/test/live_sync/live_bookmarks_sync_test.h b/chrome/test/live_sync/live_bookmarks_sync_test.h index 3ea534a..a21f8bf 100644 --- a/chrome/test/live_sync/live_bookmarks_sync_test.h +++ b/chrome/test/live_sync/live_bookmarks_sync_test.h @@ -50,7 +50,6 @@ class LiveBookmarksSyncTest : public InProcessBrowserTest { // Append command line flag to enable sync. virtual void SetUpCommandLine(CommandLine* command_line) { - command_line->AppendSwitch(switches::kEnableSync); } // Helper to get a handle on a bookmark in |m| when the url is known to be diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 1eb312d..cb380fc 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -8,6 +8,7 @@ #include "base/string_util.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/history/history_backend.h" +#include "chrome/browser/sync/profile_sync_service.h" #include "chrome/common/chrome_constants.h" #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) @@ -199,3 +200,19 @@ void TestingProfile::BlockUntilHistoryProcessesPendingRequests() { history_service_->ScheduleDBTask(new QuittingHistoryDBTask(), &consumer); MessageLoop::current()->Run(); } + +void TestingProfile::CreateProfileSyncService() { +#ifdef CHROME_PERSONALIZATION + if (!profile_sync_service_.get()) { + profile_sync_service_.reset(new ProfileSyncService(this)); + profile_sync_service_->Initialize(); + } +#endif +} + +ProfileSyncService* TestingProfile::GetProfileSyncService() { +#ifdef CHROME_PERSONALIZATION + return profile_sync_service_.get(); +#endif + return NULL; +} diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index b894d7b..f766f469 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -241,9 +241,9 @@ class TestingProfile : public Profile { // history service processes all pending requests. void BlockUntilHistoryProcessesPendingRequests(); - virtual ProfileSyncService* GetProfileSyncService() { - return NULL; - } + // Creates and initializes a profile sync service if the tests require one. + void CreateProfileSyncService(); + virtual ProfileSyncService* GetProfileSyncService(); protected: // The path of the profile; the various database and other files are relative @@ -263,6 +263,11 @@ class TestingProfile : public Profile { // The BookmarkModel. Only created if CreateBookmarkModel is invoked. scoped_ptr<BookmarkModel> bookmark_bar_model_; + // The ProfileSyncService. Created by CreateProfileSyncService. +#ifdef CHROME_PERSONALIZATION + scoped_ptr<ProfileSyncService> profile_sync_service_; +#endif + // The TemplateURLFetcher. Only created if CreateTemplateURLModel is invoked. scoped_ptr<TemplateURLModel> template_url_model_; |