summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 21:08:30 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 21:08:30 +0000
commit0f5a3da9fbc074bbb9c63163866ba5d806919d0d (patch)
tree17520be691546c964cfe7a4d2aa1afbeb07be5fb /chrome/test
parent8b37ca19491d189fe6db3ca9a5a124722373f94e (diff)
downloadchromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.zip
chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.tar.gz
chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.tar.bz2
Implement badges for page actions. Also add badge text color API.
Also change color APIs from wanting ARGB to RGBA. BUG=24635 BUG=24644 BUG=25215 Review URL: http://codereview.chromium.org/291003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/data/extensions/samples/test_browser_action/background.html1
-rw-r--r--chrome/test/data/extensions/samples/test_page_action/background.html6
2 files changed, 4 insertions, 3 deletions
diff --git a/chrome/test/data/extensions/samples/test_browser_action/background.html b/chrome/test/data/extensions/samples/test_browser_action/background.html
index 8170e86..bcf5083 100644
--- a/chrome/test/data/extensions/samples/test_browser_action/background.html
+++ b/chrome/test/data/extensions/samples/test_browser_action/background.html
@@ -5,6 +5,7 @@
var clicks = 0;
chrome.browserAction.onClicked.addListener(function() {
chrome.browserAction.setIcon({iconIndex:clicks});
+ chrome.browserAction.setBadgeText({text:""+i});
clicks++;
// We only have 1 icon, but cycle through 3 icons to test the
// out-of-bounds index bug.
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 2c5685d..d8d9d78 100644
--- a/chrome/test/data/extensions/samples/test_page_action/background.html
+++ b/chrome/test/data/extensions/samples/test_page_action/background.html
@@ -14,12 +14,12 @@
chrome.pageAction.show(info.tabId);
} else {
chrome.pageAction.hide(info.tabId);
- setTimeout(function() { chrome.pageAction.show(info.tabId); }, 1000);
+ setTimeout(function() { chrome.pageAction.show(info.tabId); }, 200);
}
chrome.pageAction.setTitle({title: "click:" + clicks, tabId: info.tabId});
chrome.pageAction.setBadgeTextColor({
tabId: info.tabId,
- color: [0, 255, clicks * 50, 255]
+ color: [255, 255, clicks * 50, 255]
});
chrome.pageAction.setBadgeBackgroundColor({
tabId: info.tabId,
@@ -27,7 +27,7 @@
});
chrome.pageAction.setBadgeText({
tabId: info.tabId,
- text: clicks + ""
+ text: i + ""
});
// We only have 2 icons, but cycle through 3 icons to test the