diff options
Diffstat (limited to 'chrome/browser/extensions/extension_prefs_unittest.h')
-rw-r--r-- | chrome/browser/extensions/extension_prefs_unittest.h | 52 |
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 |