diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-28 14:54:37 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-28 14:54:37 +0000 |
commit | b7a7540d62c4df737b152845ebd3efeaa543302d (patch) | |
tree | dd271fb590a632afe6e1f89e999fe75544dca2f5 | |
parent | 7fb966e3cf2f1e8cb3bc1faf0c99a7060ee91bf0 (diff) | |
download | chromium_src-b7a7540d62c4df737b152845ebd3efeaa543302d.zip chromium_src-b7a7540d62c4df737b152845ebd3efeaa543302d.tar.gz chromium_src-b7a7540d62c4df737b152845ebd3efeaa543302d.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
Review URL: http://codereview.chromium.org/9121068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119615 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 11 insertions, 5 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 b9e6f5b..cd72b6a 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -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 |