summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add compiler-specific "examine printf format" attributes to printfs.evan@chromium.org2009-11-201-5/+11
| | | | | | | | | | | | Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
* Parse messages.json in ExtensionUnpacker (like we do for manifest) and pass ↵cira@chromium.org2009-11-181-0/+11
| | | | | | | | | | | | | them to sandboxed_extension_unpacker. Added unittest files for unpacker and sandboxed unpacker. TEST=Try loading any of the unpacker samples added in this CL. They should either pass, or show error and fail. BUG=27362 Review URL: http://codereview.chromium.org/390019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32345 0039d316-1c4b-4281-b951-d872f2087c98
* Fix memory leak in ExtensionTest.LoadPageActionHelper unit test. The leakpam@chromium.org2009-11-101-2/+2
| | | | | | | | | | was in the test only, not in the app code. BUG=26216 TEST=covered by Linux valgrind (1) buildbot Review URL: http://codereview.chromium.org/386002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31606 0039d316-1c4b-4281-b951-d872f2087c98
* Disable ExtensionsServiceTest.InstallExtension and ↵mirandac@chromium.org2009-10-291-1/+2
| | | | | | | | | | ExtensionTest.InitFromValueInvalid until fix is in. BUG= http://crbug.com/26214 TEST= none Review URL: http://codereview.chromium.org/343038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30460 0039d316-1c4b-4281-b951-d872f2087c98
* Neither name nor title are required for page- or browser-actions. Update loaderpam@chromium.org2009-10-281-26/+39
| | | | | | | | | | and unit tests. BUG=25482 TEST=covered by unit tests Review URL: http://codereview.chromium.org/307048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30392 0039d316-1c4b-4281-b951-d872f2087c98
* Replace ExtensionAction with ExtensionAction2.aa@chromium.org2009-10-271-9/+9
| | | | | | | | BUG=24472 Review URL: http://codereview.chromium.org/337035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30172 0039d316-1c4b-4281-b951-d872f2087c98
* Move page actions over to ExtensionAction2 and get rid ofaa@chromium.org2009-10-271-77/+25
| | | | | | | | | | | | | extension_action.*. Final bit of refactor will be to rename ExtensionAction2 to ExtensionAction will be the next CL. BUG=24472,25844 Review URL: http://codereview.chromium.org/332021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30133 0039d316-1c4b-4281-b951-d872f2087c98
* Add concept of an options page to Extensions.asargent@chromium.org2009-10-161-0/+13
| | | | | | | | | | | BUG=23801 TEST=Create an extension with an "options_page" entry in its manifest with a value the name of a html file in the extension dir. Load that extension and go to chrome://extensions, there should be an "Options" button that takes you to the page specified in the manifest. Review URL: http://codereview.chromium.org/271114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29297 0039d316-1c4b-4281-b951-d872f2087c98
* Limit extensions to 1 UI surface (either Page/Browser action, but not both).finnur@chromium.org2009-10-161-1/+13
| | | | | | | | | BUG=24473 TEST=Tested using unit test. Review URL: http://codereview.chromium.org/271117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29284 0039d316-1c4b-4281-b951-d872f2087c98
* Update page action manifest parsing to match the new format.mpcomplete@chromium.org2009-10-131-24/+41
| | | | | | | | | | Preserves backwards compatability with the old manifest format. BUG=24635 Review URL: http://codereview.chromium.org/275007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28912 0039d316-1c4b-4281-b951-d872f2087c98
* Loads local resources from current locale subtree if available, if not it ↵cira@chromium.org2009-10-071-9/+0
| | | | | | | | | | | | | | | | | falls back to extension subtree. We look for ext_root/foo/bar.js under ext_root/_locales/fr/foo/bar.js if current locale is fr. If there is no fr specific resource we load ext_root/foo/bar.js instead. Lots of small refactoring to replace FilePath with ExtensionResource. BUG=12131 TEST=See unittest for sample tree. Review URL: http://codereview.chromium.org/256022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28333 0039d316-1c4b-4281-b951-d872f2087c98
* Generate IDs for --load-extension by hashing the path insteadaa@chromium.org2009-10-061-11/+23
| | | | | | | | | | | | | of incrementing a static counter. BUG=21281 TEST=Load an unpacked extension from chrome://extensions/ that does not have an ID in its manifest. The resulting ID should be random-looking, not something like "aaaaaa". Review URL: http://codereview.chromium.org/256049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28095 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate browser actions with the wrench menu. Browseraa@chromium.org2009-09-301-4/+3
| | | | | | | | | | | | actions always show up in a submenu of the wrench menu, and if they have an icon, they also show up in the toolbar area. BUG=23380,22883 TEST=Added new automated tests for the command handling, but we need to test that the menu items show up manually. To do that, run with no extension installed, you should see "extensions" in the wrench menu. Add an extension that adds a browser action, you should now see an "extensions" submenu with "manage extensions" and the browser action(s) in the submenu. Review URL: http://codereview.chromium.org/246037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27599 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid potential "NULL used as int" warnings by changing ASSERT_EQ(NULL, ...) ↵pkasting@chromium.org2009-09-291-4/+4
| | | | | | | | | to ASSERT_TRUE(... == NULL). Patch by Jacob Mandelson (see http://codereview.chromium.org/202057 ), r=me. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27511 0039d316-1c4b-4281-b951-d872f2087c98
* Moving ContextualAction class to common/extensions and in the process ↵finnur@chromium.org2009-09-281-31/+31
| | | | | | | | | | | | | renaming it ExtensionAction. No code change. BUG=None TEST=Page actions and browser actions should work as before (no change) Review URL: http://codereview.chromium.org/242035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27406 0039d316-1c4b-4281-b951-d872f2087c98
* Implement Browser Actions extensions.finnur@chromium.org2009-09-261-35/+84
| | | | | | | | | | | | | | | | Browser Actions are like Page Actions, except they appear next to the Omnibox and are always visible. For details see http://code.google.com/p/chromium/wiki/BrowserActions. Added a simple browser action sample that adds a Print button to the chrome toolbar (which brings up the Print dialog for the current page). Removed |type| from PageActions, which is currently ignored and was already removed from the docs. Each extension can only have 1 browser_action. Each browser action can specify more than one icon, but only the first is used. And no API has been added yet (besides the event definition). BUG=22099 TEST=Install the sample browser action, navigate to google.com, press the print button. A print dialog should come up. Review URL: http://codereview.chromium.org/243001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27319 0039d316-1c4b-4281-b951-d872f2087c98
* CL is the same as http://codereview.chromium.org/173487, but had to be moved ↵cira@chromium.org2009-09-181-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to new CL number because I switched machines. Implemented the rest of loading/parsing logic for extension i18n: 1. Loading message catalogs for default and application locale. 2. Parsing JSON and replacing placeholders with actual content within a message. 3. Creating unified dictionary (union of default and application dictionaries, where application dict. has priority for common messages). New class ExtensionMessageBundle holds new dictionary, and parses data. It's injected into Extension. ExtensionMessageHandler::ReplaceVariablesInString can replace both $placeholders$ and __MSG_messages__ in given string (HTML, manifest, actual message string...). Implemented actual manifest name/description replacement too, as an example. Extension is now pretty agnostic about localization, and this makes it easier to use message bundles with things that are not extensions... BUG=12131 Review URL: http://codereview.chromium.org/202063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26609 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug where we fail to install an extension that has an emptyaa@chromium.org2009-09-181-5/+1
| | | | | | | | | | | | | | | | permissions array in its manifest. This was caused an old attempt to display a warning in this situation, back when we were ambitious. BUG=22157 TEST=Install extension associated with bug. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26534 Review URL: http://codereview.chromium.org/213009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26555 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-1/+1
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-1/+1
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Don't show extension disabled infobar when manually updatingaa@chromium.org2009-08-281-17/+17
| | | | | | | | | | extensions that increase privilges. BUG=20461 Review URL: http://codereview.chromium.org/174637 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24775 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak in ExtensionTest.aa@chromium.org2009-08-271-1/+0
| | | | | | TBR=mpcomplete@chormium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24600 0039d316-1c4b-4281-b951-d872f2087c98
* Update of the extension install UI:aa@chromium.org2009-08-271-76/+138
| | | | | | | | | | | | | | | | | - Give the user more information about which hosts an extension can access. - Remove the red severe warning because it doesn't play well with themes and because it adds nothing when the other text is more specific. - Make the image a bit smaller. Also integrate this new idea with the silent/not-silent update flow. BUG=12129,12140,19582 Review URL: http://codereview.chromium.org/173463 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24599 0039d316-1c4b-4281-b951-d872f2087c98
* This change enables Chrome to load locale information for the extension. It ↵cira@chromium.org2009-08-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | detects default locale, and filters out all locales not supported by Chrome or with invalid names/missing messages. It also checks for folders that start with _ and are not in the reserved list. We don't validate messages file with this CL. Added support for loading supplied locale information to the extension_file_util, and detecting default locale. Added new constants to extension class (_locales directory name, messages filename). Added new error messages to _constants. Added new unittests. BUG=12131 TEST=There should be no visible changes, except in case of error when loading extension (e.g. create empty _locales folder and try loading). Review URL: http://codereview.chromium.org/170015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23739 0039d316-1c4b-4281-b951-d872f2087c98
* Add privacy_blacklists key to extension manifest and validate it.phajdan.jr@chromium.org2009-08-131-1/+16
| | | | | | | | | | | This is the first step towards shipping privacy blacklists in extensions. TEST=Covered by unit_tests. BUG=none Review URL: http://codereview.chromium.org/164349 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23316 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method to classify what permission class an extension is in, with unitmpcomplete@chromium.org2009-08-121-0/+80
| | | | | | | | | | tests. BUG=12140 Review URL: http://codereview.chromium.org/164335 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23229 0039d316-1c4b-4281-b951-d872f2087c98
* Implement first cut at the extension installation prompt on Windows.aa@chromium.org2009-08-041-4/+4
| | | | | | | | | | | | Had to move set_path() earlier in the unpack process so that we would have real paths for the resources, so that we could load and display the icon in the ui. This exposed a problem where page actions had absolute paths and other images in extensions had relative paths. Extension::GetBrowserImages() was expecting relative paths, and it just happened to work because in both cases Extension was initialized without a path. Modified page actions to use relative paths to be consistent with other images. Review URL: http://codereview.chromium.org/160516 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22368 0039d316-1c4b-4281-b951-d872f2087c98
* Implement mimetype sniffing for extensions.aa@chromium.org2009-07-251-0/+26
| | | | | | | | | | | abarth: can you review the changes to mime_sniffer.cc? paul: everything else? BUG=13296 TEST=Added unit tests Review URL: http://codereview.chromium.org/159345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21612 0039d316-1c4b-4281-b951-d872f2087c98
* A small start: add icons to the extension manifest.aa@chromium.org2009-07-171-2/+17
| | | | | | Review URL: http://codereview.chromium.org/155662 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20941 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor extension constants to improve readability, debugging, and to make ↵erikkay@chromium.org2009-07-131-74/+79
| | | | | | | | it easier to add new constants. Review URL: http://codereview.chromium.org/155407 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20483 0039d316-1c4b-4281-b951-d872f2087c98
* Add a couple of more extension unit tests for pagefinnur@chromium.org2009-07-021-2/+89
| | | | | | | | | | | | | actions. One for the helper function that parses a page action from the manifest and another that tests the page action api. BUG=None TEST=None Review URL: http://codereview.chromium.org/151181 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19840 0039d316-1c4b-4281-b951-d872f2087c98
* two more unit_test fixes for: http://codereview.chromium.org/140018rafaelw@chromium.org2009-06-251-0/+1
| | | | | | | | R=rvargas Review URL: http://codereview.chromium.org/147171 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19294 0039d316-1c4b-4281-b951-d872f2087c98
* Small piece of extensions auto-update: add an auto-update url member varasargent@chromium.org2009-06-181-2/+43
| | | | | | | | | | | to the Extension class. BUG=http://crbug.com/12117 TEST=none Review URL: http://codereview.chromium.org/131044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18736 0039d316-1c4b-4281-b951-d872f2087c98
* Change extension id format back to mp-decimal, and change theaa@chromium.org2009-06-131-4/+43
| | | | | | | | length to 32 chars (exactly 128 bits). Review URL: http://codereview.chromium.org/126074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18351 0039d316-1c4b-4281-b951-d872f2087c98
* Verify signed .crx extension installationsrafaelw@chromium.org2009-06-121-19/+6
| | | | | | | | | | | | | | | This is second try of: http://codereview.chromium.org/115682 that was comitted in in 18189 and reverted. BUG=12114 R=erikkay,wtc,aa Review URL: http://codereview.chromium.org/126014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18316 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "BUG=12114"tc@google.com2009-06-111-6/+19
| | | | | | | | | | | This reverts commit r18189. TBR=rafaelw Review URL: http://codereview.chromium.org/125004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18193 0039d316-1c4b-4281-b951-d872f2087c98
* BUG=12114rafaelw@chromium.org2009-06-111-19/+6
| | | | | | | | R=erikkay,wtc Review URL: http://codereview.chromium.org/115682 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18189 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused code from ExtensionsService.mpcomplete@google.com2009-05-261-0/+256
Move extension.* from browser to common, so it can be included by the utility process. Review URL: http://codereview.chromium.org/115716 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16880 0039d316-1c4b-4281-b951-d872f2087c98