Index: chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html |
diff --git a/chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html b/chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7393c5d8c6ae8706934b1834378a6ba906d8e144 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/browser_action_tab_specific_state/background.html |
@@ -0,0 +1,37 @@ |
+<html> |
+<head> |
+<script> |
+ var min = 1; |
+ var max = 5; |
+ var current = min; |
+ |
+ // Called when the user clicks on the browser action. |
+ chrome.browserAction.onClicked.addListener(function(tab) { |
+ current++; |
+ if (current > max) |
+ current = min; |
+ |
+ chrome.browserAction.setIcon({ |
+ path: "icon" + current + ".png", |
+ tabId: tab.id |
+ }); |
+ chrome.browserAction.setTitle({ |
+ title: "Showing icon " + current, |
+ tabId: tab.id |
+ }); |
+ chrome.browserAction.setBadgeText({ |
+ text: String(current), |
+ tabId: tab.id |
+ }); |
+ chrome.browserAction.setBadgeBackgroundColor({ |
+ color: [50*current,0,0,255], |
+ tabId: tab.id |
+ }); |
+ |
+ chrome.test.notifyPass(); |
+ }); |
+ |
+ chrome.test.notifyPass(); |
+</script> |
+</head> |
+</html> |