summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-02 20:33:58 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-02 20:33:58 +0000
commitae7fe7177e80bd409a1757b7421feb59973afa08 (patch)
treed015ec0294c8389176f760eb698519a8c07959b6 /chrome/renderer/extensions
parent50a441d8fcc68babce2a7dc1fc373569c8326a2a (diff)
downloadchromium_src-ae7fe7177e80bd409a1757b7421feb59973afa08.zip
chromium_src-ae7fe7177e80bd409a1757b7421feb59973afa08.tar.gz
chromium_src-ae7fe7177e80bd409a1757b7421feb59973afa08.tar.bz2
Add a couple of more extension unit tests for page
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
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r--chrome/renderer/extensions/extension_api_client_unittest.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/renderer/extensions/extension_api_client_unittest.cc b/chrome/renderer/extensions/extension_api_client_unittest.cc
index 9638b27..6cef5750 100644
--- a/chrome/renderer/extensions/extension_api_client_unittest.cc
+++ b/chrome/renderer/extensions/extension_api_client_unittest.cc
@@ -480,11 +480,20 @@ TEST_F(ExtensionAPIClientTest, SetBookmarkTitle) {
}
TEST_F(ExtensionAPIClientTest, EnablePageAction) {
+ // Basic old-school enablePageAction call.
ExpectJsPass("chrome.pageActions.enableForTab("
"\"dummy\", {tabId: 0, url: \"http://foo/\"});",
"EnablePageAction",
"[\"dummy\",{\"tabId\":0,\"url\":\"http://foo/\"}]");
+ // Try both optional parameters (title and iconId).
+ ExpectJsPass("chrome.pageActions.enableForTab("
+ "\"dummy\", {tabId: 0, url: \"http://foo/\","
+ "title: \"a\", iconId: 0});",
+ "EnablePageAction",
+ "[\"dummy\",{\"tabId\":0,\"url\":\"http://foo/\","
+ "\"title\":\"a\",\"iconId\":0}]");
+ // Now try disablePageAction.
ExpectJsPass("chrome.pageActions.disableForTab("
"\"dummy\", {tabId: 0, url: \"http://foo/\"});",
"DisablePageAction",