diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-03 08:41:20 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-03 08:41:20 +0000 |
commit | fa2416f338e2462084948d20ba7d388fb5bb0204 (patch) | |
tree | b8a12a95e3f8940cff2a5eaea6cf78766b865d7a /chrome/browser/extensions/extension_service.h | |
parent | 98b185c7db6b84e41892aa2195e784ce459a4dcc (diff) | |
download | chromium_src-fa2416f338e2462084948d20ba7d388fb5bb0204.zip chromium_src-fa2416f338e2462084948d20ba7d388fb5bb0204.tar.gz chromium_src-fa2416f338e2462084948d20ba7d388fb5bb0204.tar.bz2 |
[Extensions] Add unit tests for terminated extensions
Change enabled -> terminated state transition to be atomic.
Added unit tests for various functions' behavior with terminated
extensions.
Fix incorrect use of extension_id parameter in UninstallExtension (by renaming the parameter to extension_id_unsafe and the copy to extension_id).
Cleaned up unit tests a bit.
BUG=80756,80752
TEST=
Review URL: http://codereview.chromium.org/6889015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_service.h')
-rw-r--r-- | chrome/browser/extensions/extension_service.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index a18aab5..4801dfd 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -483,6 +483,12 @@ class ExtensionService // |client| can be NULL for a silent install. scoped_refptr<CrxInstaller> MakeCrxInstaller(ExtensionInstallUI* client); +#if defined(UNIT_TEST) + void TrackTerminatedExtensionForTest(const Extension* extension) { + TrackTerminatedExtension(extension); + } +#endif + private: // Contains Extension data that can change during the life of the process, // but does not persist across restarts. @@ -531,8 +537,12 @@ class ExtensionService bool include_terminated) const; - // Keep track of terminated extensions. + // Adds the given extension to the list of terminated extensions if + // it is not already there and unloads it. void TrackTerminatedExtension(const Extension* extension); + + // Removes the extension with the given id from the list of + // terminated extensions if it is there. void UntrackTerminatedExtension(const std::string& id); // Handles sending notification that |extension| was loaded. |