diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 05:43:53 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-14 05:43:53 +0000 |
commit | 7b291f9c1394495724ddd81306e982e840075c08 (patch) | |
tree | fa2a2ef45f1b17018e716101395300da731d8599 /chrome/test | |
parent | cc4219ad7dd27008da3db5f0e23da9a6ab2f0387 (diff) | |
download | chromium_src-7b291f9c1394495724ddd81306e982e840075c08.zip chromium_src-7b291f9c1394495724ddd81306e982e840075c08.tar.gz chromium_src-7b291f9c1394495724ddd81306e982e840075c08.tar.bz2 |
Implementation of getBackgroundPage(), getToolstrips(), and
getTabContentses().
This lands http://codereview.chromium.org/159067.
Raf, the only thing you need to look at is the changes to extensions_process_bindings.js and extension_api.json.
BUG=13577
TEST=Browser tests added
Review URL: http://codereview.chromium.org/164458
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
5 files changed, 43 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/backgroundpage.html b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/backgroundpage.html new file mode 100755 index 0000000..1bc7aee --- /dev/null +++ b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/backgroundpage.html @@ -0,0 +1,5 @@ +<html> + <script> + var isBackgroundPage = 1; + </script> +</html>
\ No newline at end of file diff --git a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/manifest.json b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/manifest.json index 65283a3..40c4860 100644 --- a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/manifest.json +++ b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/manifest.json @@ -14,6 +14,7 @@ }, "toolstrip2.html" ], + "background_page": "backgroundpage.html", "permissions": ["tabs", "http://*.google.com/*", "https://*.google.com/*"], "content_scripts": [ { diff --git a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/test_gettabs.html b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/test_gettabs.html new file mode 100755 index 0000000..47df48b --- /dev/null +++ b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/test_gettabs.html @@ -0,0 +1,5 @@ +<html> + <script> + var isTabContents = 1; + </script> +</html>
\ No newline at end of file diff --git a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html index 5d8d673..8fb82aa 100644 --- a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html +++ b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html @@ -1,4 +1,5 @@ <script> +var isToolstrip = 1; // This function is called from the C++ browser test. It does a basic sanity // test that we can call extension APIs. function testTabsAPI() { @@ -18,6 +19,34 @@ function testTabsLanguageAPI() { }); } +// This function is called from the C++ browser test. It tests the getToolstrips +// function to make sure it can be used as an extension API. This will pass if +// getToolstrips returns all toolstrip views. +function testgetToolstripsAPI() { + var views = chrome.extension.getToolstrips(); + window.domAutomationController.send(views.length == 2 && + views[0].isToolstrip == 1 && + views[1].isToolstrip == 1); +} + +// This function is called from the C++ browser test. It tests the +// getBackgroundPage function to make sure it can be used as an extension API. +// This will pass if getBackgroundPage returns background page view. +function testgetBackgroundPageAPI() { + var view = chrome.extension.getBackgroundPage(); + window.domAutomationController.send(view != null && + view.isBackgroundPage == 1); +} + +// This function is called from the C++ browser test. It tests the +// getTabContentses function to make sure it can be used as an extension API. +// This will pass if getTabContentses returns tabcontent view. +function testgetTabContentsesAPI() { + var views = chrome.extension.getTabContentses(); + window.domAutomationController.send(views.length == 1 && + views[0].isTabContents == 1); +} + </script> <select> <option>one</option> diff --git a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html index 568a6da..2f0bc54 100644 --- a/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html +++ b/chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html @@ -1 +1,4 @@ +<script> + var isToolstrip = 1; +</script> <button onclick="window.open('http://www.google.com', 'mywindow', 'width=640, height=480');">HTML button</button> |