summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-06 18:13:43 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-06 18:13:43 +0000
commit73c479313b0abb39ab8ecf5fa8f3026449d6c04c (patch)
tree768bc2e495b798cfca857cee75ac882b4a261009 /chrome/test
parent8f55e8087439851d78245881a8acd62b24251801 (diff)
downloadchromium_src-73c479313b0abb39ab8ecf5fa8f3026449d6c04c.zip
chromium_src-73c479313b0abb39ab8ecf5fa8f3026449d6c04c.tar.gz
chromium_src-73c479313b0abb39ab8ecf5fa8f3026449d6c04c.tar.bz2
Fix for Bug 50726 "Save extension list and "winning" prefs from extensions"
This is a redesign for http://codereview.chromium.org/4852002/ following discussions. The goal of this patch is to ensure that Chrome maintains the order in which extensions apply their preferences between restarts. This may be an issue if two extensions overwrite each others preferences. Furthermore, it ensures that preferences are persisted to disk between browser restarts. Therefore, previous settings are immediately available when the browser is restarted. A description of the design has been published https://docs.google.com/a/google.com/document/d/1E_HX_cUpET1gH2gDunGIU1EOywMM6FEOuVU6TlpnSwo/edit?hl=en for review and comments. - Sorry, accessible Google internally only. This CL requires http://codereview.chromium.org/5204006/ Contributed by battre@google.com BUG=50726 TEST=none Review URL: http://codereview.chromium.org/5213002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/testing_pref_service.cc14
-rw-r--r--chrome/test/testing_profile.cc4
-rw-r--r--chrome/test/testing_profile.h7
3 files changed, 16 insertions, 9 deletions
diff --git a/chrome/test/testing_pref_service.cc b/chrome/test/testing_pref_service.cc
index d8d08e5..3713c8c 100644
--- a/chrome/test/testing_pref_service.cc
+++ b/chrome/test/testing_pref_service.cc
@@ -14,13 +14,13 @@
// which they want, and expand usage of this class to more unit tests.
TestingPrefService::TestingPrefService()
: PrefService(new TestingPrefValueStore(
- managed_platform_prefs_ = new DummyPrefStore(),
- device_management_prefs_ = new DummyPrefStore(),
- NULL,
- NULL,
- user_prefs_ = new DummyPrefStore(),
- NULL,
- default_prefs_ = new DummyPrefStore())) {
+ managed_platform_prefs_ = new DummyPrefStore(),
+ device_management_prefs_ = new DummyPrefStore(),
+ NULL,
+ NULL,
+ user_prefs_ = new DummyPrefStore(),
+ NULL,
+ default_prefs_ = new DummyPrefStore())) {
}
TestingPrefService::TestingPrefService(
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index c36f66b..52e5332 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -249,7 +249,7 @@ void TestingProfile::DestroyHistoryService() {
void TestingProfile::CreateTopSites() {
DestroyTopSites();
top_sites_ = new history::TopSites(this);
- FilePath file_name = temp_dir_.path().Append(chrome::kTopSitesFilename);
+ FilePath file_name = GetPath().Append(chrome::kTopSitesFilename);
top_sites_->Init(file_name);
}
@@ -347,9 +347,11 @@ void TestingProfile::UseThemeProvider(BrowserThemeProvider* theme_provider) {
scoped_refptr<ExtensionsService> TestingProfile::CreateExtensionsService(
const CommandLine* command_line,
const FilePath& install_directory) {
+ extension_prefs_.reset(new ExtensionPrefs(GetPrefs(),install_directory));
extensions_service_ = new ExtensionsService(this,
command_line,
install_directory,
+ extension_prefs_.get(),
false);
return extensions_service_;
}
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index 6e6b6b4..3469c33 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -25,6 +25,7 @@ class BookmarkModel;
class BrowserThemeProvider;
class CommandLine;
class DesktopNotificationService;
+class ExtensionPrefs;
class FaviconService;
class FindBarState;
class GeolocationContentSettingsMap;
@@ -328,7 +329,7 @@ class TestingProfile : public Profile {
// from the destructor.
void DestroyWebDataService();
- // Creates a TestingPrefService and associates it with the TestingProfile
+ // Creates a TestingPrefService and associates it with the TestingProfile.
void CreateTestingPrefService();
// The favicon service. Only created if CreateFaviconService is invoked.
@@ -404,6 +405,10 @@ class TestingProfile : public Profile {
FilePath last_selected_directory_;
scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails.
+ // The Extension Preferences. Only created if CreateExtensionsService is
+ // invoked.
+ scoped_ptr<ExtensionPrefs> extension_prefs_;
+
// For properly notifying the ExtensionsService when the profile
// is disposed.
scoped_refptr<ExtensionsService> extensions_service_;