summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_prefs_unittest.h
diff options
context:
space:
mode:
authorrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 20:54:13 +0000
committerrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 20:54:13 +0000
commit6d8a0b0937f27a61a84bc7d19bc7c689a714aa45 (patch)
tree157bfbb0a910e6f4246b3e4a28050d7db941b7df /chrome/browser/extensions/extension_prefs_unittest.h
parent586d6f15802e4f1a873b2d0709d1b5f32da2bc7f (diff)
downloadchromium_src-6d8a0b0937f27a61a84bc7d19bc7c689a714aa45.zip
chromium_src-6d8a0b0937f27a61a84bc7d19bc7c689a714aa45.tar.gz
chromium_src-6d8a0b0937f27a61a84bc7d19bc7c689a714aa45.tar.bz2
Move Extension-Controlled Preference functions from ExtPrefs to PreferenceAPI
Move [Set|Remove]ExtensionControlledPref and [Can|Does]ExtensionControlPref functions from ExtensionPrefs to PreferenceAPI, since these functions were only ever used in APIs. This required restructing the ExtensionPrefs unittests slightly, so that derived testing classes (tests for ExtensionSorting) don't inherit controlled pref methods, and the functions are isolated in APIs. BUG=180083 Review URL: https://chromiumcodereview.appspot.com/15582003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_prefs_unittest.h')
-rw-r--r--chrome/browser/extensions/extension_prefs_unittest.h52
1 files changed, 16 insertions, 36 deletions
diff --git a/chrome/browser/extensions/extension_prefs_unittest.h b/chrome/browser/extensions/extension_prefs_unittest.h
index eb3cf6c..0f42488 100644
--- a/chrome/browser/extensions/extension_prefs_unittest.h
+++ b/chrome/browser/extensions/extension_prefs_unittest.h
@@ -55,49 +55,29 @@ class ExtensionPrefsTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(ExtensionPrefsTest);
};
-class ExtensionPrefsPrepopulatedTest : public ExtensionPrefsTest {
- public:
- ExtensionPrefsPrepopulatedTest();
- virtual ~ExtensionPrefsPrepopulatedTest();
-
- virtual void RegisterPreferences(
- user_prefs::PrefRegistrySyncable* registry) OVERRIDE;
-
- void InstallExtControlledPref(Extension* ext,
- const std::string& key,
- base::Value* val);
-
- void InstallExtControlledPrefIncognito(Extension* ext,
- const std::string& key,
- base::Value* val);
- void InstallExtControlledPrefIncognitoSessionOnly(
- Extension* ext,
- const std::string& key,
- base::Value* val);
+class PrefsPrepopulatedTestBase : public ExtensionPrefsTest {
+ public:
+ static const size_t kNumInstalledExtensions = 4;
- void InstallExtension(Extension* ext);
+ PrefsPrepopulatedTestBase();
+ virtual ~PrefsPrepopulatedTestBase();
- void UninstallExtension(const std::string& extension_id);
+ Extension* extension1() { return extension1_.get(); }
+ Extension* extension2() { return extension2_.get(); }
+ Extension* extension3() { return extension3_.get(); }
+ Extension* extension4() { return extension4_.get(); }
- // Weak references, for convenience.
- Extension* ext1_;
- Extension* ext2_;
- Extension* ext3_;
- Extension* ext4_;
+ protected:
+ bool installed_[kNumInstalledExtensions];
- // Flags indicating whether each of the extensions has been installed, yet.
- bool installed[4];
+ scoped_refptr<Extension> extension1_;
+ scoped_refptr<Extension> extension2_;
+ scoped_refptr<Extension> extension3_;
+ scoped_refptr<Extension> extension4_;
private:
- void EnsureExtensionInstalled(Extension *ext);
-
- void EnsureExtensionUninstalled(const std::string& extension_id);
-
- scoped_refptr<Extension> ext1_scoped_;
- scoped_refptr<Extension> ext2_scoped_;
- scoped_refptr<Extension> ext3_scoped_;
- scoped_refptr<Extension> ext4_scoped_;
+ DISALLOW_COPY_AND_ASSIGN(PrefsPrepopulatedTestBase);
};
} // namespace extensions