diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-29 08:58:02 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-29 08:58:02 +0000 |
commit | 8d2bbd66c39aa63173e1819fa41dab7cf6f5c371 (patch) | |
tree | 1c0984591b88e2c22dbf2d4ef8fbbe4931d0226f | |
parent | fa51fd99e6484f0f870d15fab3eb9d03fa58069f (diff) | |
download | chromium_src-8d2bbd66c39aa63173e1819fa41dab7cf6f5c371.zip chromium_src-8d2bbd66c39aa63173e1819fa41dab7cf6f5c371.tar.gz chromium_src-8d2bbd66c39aa63173e1819fa41dab7cf6f5c371.tar.bz2 |
Enable syncing of extension settings in integration tests.
So that this doesn't crash, make ExtensionSettingDataTypeController call
InitExtensions on Profile (like ExtensionDataTypeController already does).
BUG=
TEST=sync_integration_tests
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=119615
Review URL: http://codereview.chromium.org/9121068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119634 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc index 83a872b..e48b4d7 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc @@ -26,8 +26,7 @@ ExtensionSettingDataTypeController::ExtensionSettingDataTypeController( profile, profile_sync_service), type_(type), - settings_frontend_( - profile->GetExtensionService()->settings_frontend()), + profile_(profile), profile_sync_service_(profile_sync_service), settings_service_(NULL) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); @@ -47,13 +46,16 @@ ExtensionSettingDataTypeController::model_safe_group() const { } bool ExtensionSettingDataTypeController::StartModels() { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + profile_->InitExtensions(true); return true; } bool ExtensionSettingDataTypeController::StartAssociationAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(state(), ASSOCIATING); - settings_frontend_->RunWithSyncableService( + DCHECK(profile_->GetExtensionService()); + profile_->GetExtensionService()->settings_frontend()->RunWithSyncableService( type_, base::Bind( &ExtensionSettingDataTypeController:: diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.h b/chrome/browser/sync/glue/extension_setting_data_type_controller.h index 3c330d4..cd72b6a 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.h @@ -58,7 +58,7 @@ class ExtensionSettingDataTypeController syncable::ModelType type_; // These only used on the UI thread. - extensions::SettingsFrontend* settings_frontend_; + Profile* profile_; ProfileSyncService* profile_sync_service_; // Only used on the FILE thread. diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index fdd9c93..6a3cce2 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -216,6 +216,10 @@ void SyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) { // TODO(sync): Remove this once sessions sync is enabled by default. if (!cl->HasSwitch(switches::kEnableSyncTabs)) cl->AppendSwitch(switches::kEnableSyncTabs); + // TODO(kalman): Remove this once extension/app settings sync is enabled by + // default. + if (!cl->HasSwitch(switches::kEnableSyncExtensionSettings)) + cl->AppendSwitch(switches::kEnableSyncExtensionSettings); } // static |