summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 05:16:54 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 05:16:54 +0000
commitbf28f5f87c717257ef566e4f7a22d116d088f59e (patch)
treeb6a1cb91e83a23973187116c3aaec3041af27538 /chrome/test
parentdd3e02abd586bcb898a557713b2636e0f4999990 (diff)
downloadchromium_src-bf28f5f87c717257ef566e4f7a22d116d088f59e.zip
chromium_src-bf28f5f87c717257ef566e4f7a22d116d088f59e.tar.gz
chromium_src-bf28f5f87c717257ef566e4f7a22d116d088f59e.tar.bz2
Implement chrome.browserAction.setIcon({path:...});
BUG=22575 Review URL: http://codereview.chromium.org/269103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rwxr-xr-xchrome/test/data/extensions/api_test/browser_action_no_icon/update2.html10
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/background.html20
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/icon1.pngbin0 -> 2809 bytes
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/icon2.pngbin0 -> 2809 bytes
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/icon3.pngbin0 -> 2809 bytes
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/icon4.pngbin0 -> 2809 bytes
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/icon5.pngbin0 -> 2809 bytes
-rwxr-xr-xchrome/test/data/extensions/samples/set_icon_path/manifest.json11
8 files changed, 41 insertions, 0 deletions
diff --git a/chrome/test/data/extensions/api_test/browser_action_no_icon/update2.html b/chrome/test/data/extensions/api_test/browser_action_no_icon/update2.html
new file mode 100755
index 0000000..d5702ff
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/browser_action_no_icon/update2.html
@@ -0,0 +1,10 @@
+<html>
+<body>
+<canvas id="canvas" width="27" height="23">
+<script>
+ // Test that setting an icon using its relative path works.
+ chrome.browserAction.setIcon({path: "icon.png"});
+ chrome.test.notifyPass();
+</script>
+</body>
+</html>
diff --git a/chrome/test/data/extensions/samples/set_icon_path/background.html b/chrome/test/data/extensions/samples/set_icon_path/background.html
new file mode 100755
index 0000000..11aea5a
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/background.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<script>
+ var min = 1;
+ var max = 5;
+ var current = min;
+
+ function updateIcon() {
+ chrome.browserAction.setIcon({path:"icon" + current + ".png"});
+ current++;
+
+ if (current > max)
+ current = min;
+ }
+
+ chrome.browserAction.onClicked.addListener(updateIcon);
+ updateIcon();
+</script>
+</head>
+</html>
diff --git a/chrome/test/data/extensions/samples/set_icon_path/icon1.png b/chrome/test/data/extensions/samples/set_icon_path/icon1.png
new file mode 100755
index 0000000..9a79a46
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/icon1.png
Binary files differ
diff --git a/chrome/test/data/extensions/samples/set_icon_path/icon2.png b/chrome/test/data/extensions/samples/set_icon_path/icon2.png
new file mode 100755
index 0000000..8d3f710
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/icon2.png
Binary files differ
diff --git a/chrome/test/data/extensions/samples/set_icon_path/icon3.png b/chrome/test/data/extensions/samples/set_icon_path/icon3.png
new file mode 100755
index 0000000..2d9dec3
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/icon3.png
Binary files differ
diff --git a/chrome/test/data/extensions/samples/set_icon_path/icon4.png b/chrome/test/data/extensions/samples/set_icon_path/icon4.png
new file mode 100755
index 0000000..896fc36
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/icon4.png
Binary files differ
diff --git a/chrome/test/data/extensions/samples/set_icon_path/icon5.png b/chrome/test/data/extensions/samples/set_icon_path/icon5.png
new file mode 100755
index 0000000..a5afa25
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/icon5.png
Binary files differ
diff --git a/chrome/test/data/extensions/samples/set_icon_path/manifest.json b/chrome/test/data/extensions/samples/set_icon_path/manifest.json
new file mode 100755
index 0000000..ceffb65
--- /dev/null
+++ b/chrome/test/data/extensions/samples/set_icon_path/manifest.json
@@ -0,0 +1,11 @@
+{
+ "name": "A browser action with no icon that makes the page red",
+ "version": "1.0",
+ "background_page": "background.html",
+ "permissions": [
+ "tabs", "http://*/*"
+ ],
+ "browser_action": {
+ "name": "Make this page red"
+ }
+} \ No newline at end of file