From ae7fe7177e80bd409a1757b7421feb59973afa08 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Thu, 2 Jul 2009 20:33:58 +0000 Subject: 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 --- chrome/renderer/extensions/extension_api_client_unittest.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'chrome/renderer/extensions') 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", -- cgit v1.1