diff options
Diffstat (limited to 'chrome/test/data/extensions')
-rw-r--r-- | chrome/test/data/extensions/samples/test_page_action/background.html | 23 | ||||
-rwxr-xr-x | chrome/test/data/extensions/samples/test_page_action/icon1.png | bin | 0 -> 2809 bytes | |||
-rwxr-xr-x | chrome/test/data/extensions/samples/test_page_action/icon2.png | bin | 0 -> 2809 bytes | |||
-rw-r--r-- | chrome/test/data/extensions/samples/test_page_action/manifest.json | 3 | ||||
-rw-r--r-- | chrome/test/data/extensions/samples/test_page_action/print_16x16.png | bin | 647 -> 0 bytes |
5 files changed, 10 insertions, 16 deletions
diff --git a/chrome/test/data/extensions/samples/test_page_action/background.html b/chrome/test/data/extensions/samples/test_page_action/background.html index b9de03d..2b77a66 100644 --- a/chrome/test/data/extensions/samples/test_page_action/background.html +++ b/chrome/test/data/extensions/samples/test_page_action/background.html @@ -2,15 +2,18 @@ <head> <script> var lastTabId = 0; + var visible = false; chrome.tabs.onUpdated.addListener(function(tabId, p) { lastTabId = tabId; + chrome.pageAction.show(tabId); }); - // Called when the user clicks on the browser action. + // Called when the user clicks on the page action. var clicks = 0; var text = ""; chrome.pageAction.onClicked.addListener(function(_, info) { - chrome.pageAction.setIcon({iconIndex: clicks, tabId: info.tabId}); + chrome.pageAction.setIcon({path: "icon" + (clicks + 1) + ".png", + tabId: info.tabId}); if (clicks % 2) { chrome.pageAction.show(info.tabId); } else { @@ -18,19 +21,7 @@ setTimeout(function() { chrome.pageAction.show(info.tabId); }, 200); } chrome.pageAction.setTitle({title: "click:" + clicks, tabId: info.tabId}); - chrome.pageAction.setBadgeTextColor({ - tabId: info.tabId, - color: [255, 255, clicks * 50, 255] - }); - chrome.pageAction.setBadgeBackgroundColor({ - tabId: info.tabId, - color: [255, clicks * 50, 0, 255] - }); text += clicks.toString(); - chrome.pageAction.setBadgeText({ - tabId: info.tabId, - text: text - }); // We only have 2 icons, but cycle through 3 icons to test the // out-of-bounds index bug. @@ -43,6 +34,10 @@ window.setInterval(function() { // Don't animate while in "click" mode. if (clicks > 0) return; + + // Don't do anything if we don't have a tab yet. + if (lastTabId == 0) return; + i++; chrome.pageAction.setIcon({imageData: draw(i*2, i*4), tabId: lastTabId}); }, 50); diff --git a/chrome/test/data/extensions/samples/test_page_action/icon1.png b/chrome/test/data/extensions/samples/test_page_action/icon1.png Binary files differnew file mode 100755 index 0000000..9a79a46 --- /dev/null +++ b/chrome/test/data/extensions/samples/test_page_action/icon1.png diff --git a/chrome/test/data/extensions/samples/test_page_action/icon2.png b/chrome/test/data/extensions/samples/test_page_action/icon2.png Binary files differnew file mode 100755 index 0000000..8d3f710 --- /dev/null +++ b/chrome/test/data/extensions/samples/test_page_action/icon2.png diff --git a/chrome/test/data/extensions/samples/test_page_action/manifest.json b/chrome/test/data/extensions/samples/test_page_action/manifest.json index 28e0dab..5a374e8 100644 --- a/chrome/test/data/extensions/samples/test_page_action/manifest.json +++ b/chrome/test/data/extensions/samples/test_page_action/manifest.json @@ -5,7 +5,6 @@ "permissions": ["tabs"], "background_page": "background.html", "page_action": { - "default_title": "First icon", - "default_icon": "print_16x16.png" + "default_title": "First icon" } } diff --git a/chrome/test/data/extensions/samples/test_page_action/print_16x16.png b/chrome/test/data/extensions/samples/test_page_action/print_16x16.png Binary files differdeleted file mode 100644 index d145964..0000000 --- a/chrome/test/data/extensions/samples/test_page_action/print_16x16.png +++ /dev/null |