summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 19:58:47 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 19:58:47 +0000
commitffae8831cb1c0b281914b032617f7bbd7d86bcea (patch)
treedb3e44ae7ab368ec2c6cdcd6bb376cf9bac4d004 /chrome/test
parent1d99bfac92febc985149d026563e53a0888f76af (diff)
downloadchromium_src-ffae8831cb1c0b281914b032617f7bbd7d86bcea.zip
chromium_src-ffae8831cb1c0b281914b032617f7bbd7d86bcea.tar.gz
chromium_src-ffae8831cb1c0b281914b032617f7bbd7d86bcea.tar.bz2
New event style for pageAction API.
This makes us fire both the old deprecated style of pageActions click handler and the new pageAction style. BUG=25833 TEST=none Review URL: http://codereview.chromium.org/346006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/extensions/api_test/old_page_actions/background.html18
-rw-r--r--chrome/test/data/extensions/api_test/old_page_actions/icon.pngbin0 -> 2809 bytes
-rw-r--r--chrome/test/data/extensions/api_test/old_page_actions/manifest.json13
-rw-r--r--chrome/test/data/extensions/api_test/old_page_actions/page.html13
4 files changed, 44 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/old_page_actions/background.html b/chrome/test/data/extensions/api_test/old_page_actions/background.html
new file mode 100644
index 0000000..650d37a
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/old_page_actions/background.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+<script>
+
+chrome.pageActions["action"].addListener(function(actionId, info) {
+ if (actionId == "action" && typeof(info.tabId) == "number" &&
+ typeof(info.tabUrl) == "string" && info.button == 1) {
+ chrome.test.notifyPass();
+ } else {
+ chrome.test.notifyFail("pageActions listener failed");
+ }
+});
+
+chrome.test.notifyPass();
+
+</script>
+</head>
+</html>
diff --git a/chrome/test/data/extensions/api_test/old_page_actions/icon.png b/chrome/test/data/extensions/api_test/old_page_actions/icon.png
new file mode 100644
index 0000000..9a79a46
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/old_page_actions/icon.png
Binary files differ
diff --git a/chrome/test/data/extensions/api_test/old_page_actions/manifest.json b/chrome/test/data/extensions/api_test/old_page_actions/manifest.json
new file mode 100644
index 0000000..b1d2b09
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/old_page_actions/manifest.json
@@ -0,0 +1,13 @@
+{
+ "name": "Test of old-style page actions API",
+ "version": "1.0",
+ "background_page": "background.html",
+ "permissions": ["tabs"],
+ "page_actions": [
+ { "id": "action",
+ "name": "action",
+ "icons": ["icon.png"]
+ }
+ ],
+ "background_page": "background.html"
+}
diff --git a/chrome/test/data/extensions/api_test/old_page_actions/page.html b/chrome/test/data/extensions/api_test/old_page_actions/page.html
new file mode 100644
index 0000000..686e9066
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/old_page_actions/page.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+<script>
+
+// Enable the page action on this tab.
+chrome.tabs.getSelected(null, function(tab) {
+ chrome.pageActions.enableForTab("action", {"tabId":tab.id, "url":tab.url});
+ chrome.test.notifyPass();
+});
+
+</script>
+</body>
+</html>