diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 16:44:43 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 16:44:43 +0000 |
commit | 9c45b718e0b24664945c98d7a6315e4666fe7c22 (patch) | |
tree | 8697f8b5890b4a0f6121a76adf17a00045943068 /chrome/renderer | |
parent | 79ae821680fd8d84cc567063ead475072b799bc9 (diff) | |
download | chromium_src-9c45b718e0b24664945c98d7a6315e4666fe7c22.zip chromium_src-9c45b718e0b24664945c98d7a6315e4666fe7c22.tar.gz chromium_src-9c45b718e0b24664945c98d7a6315e4666fe7c22.tar.bz2 |
mole API - take 2
originally reviewed / committed as http://codereview.chromium.org/160276
TBR=mpcomplete,phadjan.jr
Review URL: http://codereview.chromium.org/159854
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/extensions/extension_api_client_unittest.cc | 41 | ||||
-rw-r--r-- | chrome/renderer/renderer_resources.grd | 2 |
2 files changed, 42 insertions, 1 deletions
diff --git a/chrome/renderer/extensions/extension_api_client_unittest.cc b/chrome/renderer/extensions/extension_api_client_unittest.cc index bd0ce09..5465a5c 100644 --- a/chrome/renderer/extensions/extension_api_client_unittest.cc +++ b/chrome/renderer/extensions/extension_api_client_unittest.cc @@ -518,3 +518,44 @@ TEST_F(ExtensionAPIClientTest, EnablePageAction) { "pageActions.disableForTab", "[\"dummy\",{\"tabId\":0,\"url\":\"http://foo/\"}]"); } + +TEST_F(ExtensionAPIClientTest, ExpandToolstrip) { + ExpectJsPass("chrome.toolstrip.expand(100, 'http://foo/')", + "toolstrip.expand", + "[100,\"http://foo/\"]"); + ExpectJsPass("chrome.toolstrip.expand(100, null)", + "toolstrip.expand", + "[100,null]"); + ExpectJsPass("chrome.toolstrip.expand(100, 'http://foo/', function(){})", + "toolstrip.expand", + "[100,\"http://foo/\"]"); + + ExpectJsFail("chrome.toolstrip.expand('100', 'http://foo/')", + "Uncaught Error: Invalid value for argument 0. " + "Expected 'integer' but got 'string'."); + ExpectJsFail("chrome.toolstrip.expand(100, 100)", + "Uncaught Error: Invalid value for argument 1. " + "Expected 'string' but got 'integer'."); + ExpectJsFail("chrome.toolstrip.expand(100, 'http://foo/', 32)", + "Uncaught Error: Invalid value for argument 2. " + "Expected 'function' but got 'integer'."); +} + +TEST_F(ExtensionAPIClientTest, CollapseToolstrip) { + ExpectJsPass("chrome.toolstrip.collapse('http://foo/')", + "toolstrip.collapse", + "\"http://foo/\""); + ExpectJsPass("chrome.toolstrip.collapse(null)", + "toolstrip.collapse", + "null"); + ExpectJsPass("chrome.toolstrip.collapse('http://foo/', function(){})", + "toolstrip.collapse", + "\"http://foo/\""); + + ExpectJsFail("chrome.toolstrip.collapse(100)", + "Uncaught Error: Invalid value for argument 0. " + "Expected 'string' but got 'integer'."); + ExpectJsFail("chrome.toolstrip.collapse('http://foo/', 32)", + "Uncaught Error: Invalid value for argument 1. " + "Expected 'function' but got 'integer'."); +} diff --git a/chrome/renderer/renderer_resources.grd b/chrome/renderer/renderer_resources.grd index 5e05578..ec1d32c 100644 --- a/chrome/renderer/renderer_resources.grd +++ b/chrome/renderer/renderer_resources.grd @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- This comment is only here because changes to resources are not picked up -without changes to the corresponding grd file. rw3 --> +without changes to the corresponding grd file. ek2 --> <grit latest_public_release="0" current_release="1"> <outputs> <output filename="grit/renderer_resources.h" type="rc_header"> |