diff options
Diffstat (limited to 'chrome/test')
11 files changed, 96 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/page_action/add_popup/a_popup.html b/chrome/test/data/extensions/api_test/page_action/add_popup/a_popup.html new file mode 100755 index 0000000..4e0a93f --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/add_popup/a_popup.html @@ -0,0 +1,5 @@ +<head> +</head> +<body> +<div id="test">I am a popup!</div> +</body> diff --git a/chrome/test/data/extensions/api_test/page_action/add_popup/another_popup.html b/chrome/test/data/extensions/api_test/page_action/add_popup/another_popup.html new file mode 100644 index 0000000..b2f61b1 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/add_popup/another_popup.html @@ -0,0 +1,5 @@ +<html> + <body> + Another popup. + </body> +</html> diff --git a/chrome/test/data/extensions/api_test/page_action/add_popup/background.html b/chrome/test/data/extensions/api_test/page_action/add_popup/background.html new file mode 100644 index 0000000..64551c2 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/add_popup/background.html @@ -0,0 +1,20 @@ +<script> + +chrome.tabs.getSelected(null, function(tab) { + chrome.pageAction.show(tab.id); + + // When the page action icon is clicked for the first time, add a popup. + chrome.pageAction.onClicked.addListener(function(tab) { + window.tabId = tab.id; + + chrome.pageAction.setPopup({ + tabId: tab.id, + popup: 'a_popup.html' + }); + chrome.test.notifyPass(); + }); + + chrome.test.notifyPass(); +}); + +</script> diff --git a/chrome/test/data/extensions/api_test/page_action/add_popup/change_popup.html b/chrome/test/data/extensions/api_test/page_action/add_popup/change_popup.html new file mode 100644 index 0000000..dcc3a25 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/add_popup/change_popup.html @@ -0,0 +1,13 @@ +<html> + <body> + <script> + chrome.tabs.getSelected(null, function(tab) { + chrome.pageAction.setPopup({ + tabId: tab.id, + popup: 'another_popup.html' + }); + chrome.test.notifyPass(); + }); + </script> + </body> +</html> diff --git a/chrome/test/data/extensions/api_test/page_action/add_popup/icon.png b/chrome/test/data/extensions/api_test/page_action/add_popup/icon.png Binary files differnew file mode 100755 index 0000000..9a79a46 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/add_popup/icon.png diff --git a/chrome/test/data/extensions/api_test/page_action/add_popup/manifest.json b/chrome/test/data/extensions/api_test/page_action/add_popup/manifest.json new file mode 100755 index 0000000..d2f45c3 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/add_popup/manifest.json @@ -0,0 +1,12 @@ +{ + "name": "A page action which adds a popup.", + "version": "1.0", + "background_page": "background.html", + "permissions": [ + "tabs", "http://*/*" + ], + "page_action": { + "default_title": "Popup Title", + "default_icon": "icon.png" + } +} diff --git a/chrome/test/data/extensions/api_test/page_action/remove_popup/a_popup.html b/chrome/test/data/extensions/api_test/page_action/remove_popup/a_popup.html new file mode 100755 index 0000000..4e0a93f --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/remove_popup/a_popup.html @@ -0,0 +1,5 @@ +<head> +</head> +<body> +<div id="test">I am a popup!</div> +</body> diff --git a/chrome/test/data/extensions/api_test/page_action/remove_popup/background.html b/chrome/test/data/extensions/api_test/page_action/remove_popup/background.html new file mode 100644 index 0000000..4b6e470 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/remove_popup/background.html @@ -0,0 +1,10 @@ +<html> + <body> + <script> + chrome.tabs.getSelected(null, function(tab) { + chrome.pageAction.show(tab.id); + chrome.test.notifyPass(); + }); + </script> + </body> +</html> diff --git a/chrome/test/data/extensions/api_test/page_action/remove_popup/icon.png b/chrome/test/data/extensions/api_test/page_action/remove_popup/icon.png Binary files differnew file mode 100755 index 0000000..9a79a46 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/remove_popup/icon.png diff --git a/chrome/test/data/extensions/api_test/page_action/remove_popup/manifest.json b/chrome/test/data/extensions/api_test/page_action/remove_popup/manifest.json new file mode 100755 index 0000000..50a28f8 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/remove_popup/manifest.json @@ -0,0 +1,13 @@ +{ + "name": "A page action which removes a popup.", + "version": "1.0", + "background_page": "background.html", + "permissions": [ + "tabs", "http://*/*" + ], + "page_action": { + "default_title": "Popup Title", + "default_icon": "icon.png", + "default_popup": "a_popup.html" + } +} diff --git a/chrome/test/data/extensions/api_test/page_action/remove_popup/remove_popup.html b/chrome/test/data/extensions/api_test/page_action/remove_popup/remove_popup.html new file mode 100644 index 0000000..05acc68 --- /dev/null +++ b/chrome/test/data/extensions/api_test/page_action/remove_popup/remove_popup.html @@ -0,0 +1,13 @@ +<html> + <body> + <script> + chrome.tabs.getSelected(null, function(tab) { + chrome.pageAction.setPopup({ + tabId: tab.id, + popup: '' // No popup. + }); + chrome.test.notifyPass(); + }); + </script> + </body> +</html> |