summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/extensions
diff options
context:
space:
mode:
authorerikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 14:57:25 +0000
committererikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 14:57:25 +0000
commitab32b16c9acd73a2f2d2a92f1e8e5083b51b3953 (patch)
treee3910fea8522ea0a6e34d30b40a0a659c4a9d93f /chrome/test/data/extensions
parent357ff69d8564f44ffb7eb8ff3214d9cf7885dd63 (diff)
downloadchromium_src-ab32b16c9acd73a2f2d2a92f1e8e5083b51b3953.zip
chromium_src-ab32b16c9acd73a2f2d2a92f1e8e5083b51b3953.tar.gz
chromium_src-ab32b16c9acd73a2f2d2a92f1e8e5083b51b3953.tar.bz2
Popup width and height are now dynamic.
BUG=24471 TEST=none Review URL: http://codereview.chromium.org/273046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/extensions')
-rwxr-xr-xchrome/test/data/extensions/api_test/popup/chromium.pngbin0 -> 1736 bytes
-rwxr-xr-xchrome/test/data/extensions/api_test/popup/manifest.json10
-rwxr-xr-xchrome/test/data/extensions/api_test/popup/popup.html44
-rw-r--r--chrome/test/data/extensions/samples/buildbot/manifest.json2
-rwxr-xr-xchrome/test/data/extensions/samples/buildbot/popup.html32
5 files changed, 82 insertions, 6 deletions
diff --git a/chrome/test/data/extensions/api_test/popup/chromium.png b/chrome/test/data/extensions/api_test/popup/chromium.png
new file mode 100755
index 0000000..cc9fb60
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/popup/chromium.png
Binary files differ
diff --git a/chrome/test/data/extensions/api_test/popup/manifest.json b/chrome/test/data/extensions/api_test/popup/manifest.json
new file mode 100755
index 0000000..f353316
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/popup/manifest.json
@@ -0,0 +1,10 @@
+{
+ "name": "Popup tester",
+ "version": "0.1",
+ "description": "apitest for popups",
+ "browser_action": {
+ "name": "grow",
+ "icons": ["chromium.png"],
+ "popup": "popup.html"
+ }
+}
diff --git a/chrome/test/data/extensions/api_test/popup/popup.html b/chrome/test/data/extensions/api_test/popup/popup.html
new file mode 100755
index 0000000..02d6342
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/popup/popup.html
@@ -0,0 +1,44 @@
+<head>
+<script>
+function run_tests() {
+ // Compute the size of the popup.
+ var width = 100;
+ var height = 100;
+ if (localStorage.height) {
+ height = parseInt(localStorage.height);
+ }
+ if (localStorage.width) {
+ width = parseInt(localStorage.width);
+ }
+
+ // Set the div's size.
+ var test = document.getElementById("test");
+ test.style.width = width + "px";
+ test.style.height = height + "px";
+ chrome.test.log("height: " + test.offsetHeight);
+ chrome.test.log("width: " + test.offsetWidth);
+
+ // We should be done. Let the test harness know.
+ //window.setTimeout(chrome.test.notifyPass, 0);
+ chrome.test.notifyPass();
+
+ height += 100;
+ width += 100;
+ localStorage.height = JSON.stringify(height);
+ localStorage.width = JSON.stringify(width);
+}
+</script>
+<style>
+body {
+ padding: 0px;
+ margin: 0px;
+}
+div {
+ padding: 0px;
+ margin: 0px;
+}
+</style>
+</head>
+<body onload="window.setTimeout(run_tests, 0)">
+<div id="test">TEST</div>
+</body>
diff --git a/chrome/test/data/extensions/samples/buildbot/manifest.json b/chrome/test/data/extensions/samples/buildbot/manifest.json
index ea764ef..39f6680 100644
--- a/chrome/test/data/extensions/samples/buildbot/manifest.json
+++ b/chrome/test/data/extensions/samples/buildbot/manifest.json
@@ -12,6 +12,6 @@
"browser_action": {
"name": "Buildbot status",
"icons": ["chromium.png"],
- "popup": { "path": "popup.html", "height": 200 }
+ "popup": "popup.html"
}
}
diff --git a/chrome/test/data/extensions/samples/buildbot/popup.html b/chrome/test/data/extensions/samples/buildbot/popup.html
index 415c061..ca2314a 100755
--- a/chrome/test/data/extensions/samples/buildbot/popup.html
+++ b/chrome/test/data/extensions/samples/buildbot/popup.html
@@ -1,3 +1,4 @@
+<head>
<script>
var botRoot = "http://build.chromium.org/buildbot/waterfall";
//var botRoot = "http://chrome-buildbot.corp.google.com:8010";
@@ -82,24 +83,42 @@ function requestURL(url, callback) {
}
window.onload = function() {
bots = document.getElementById("bots");
- bots.innerHTML = "onload";
- //window.setTimeout(requestUrl(waterfallURL, updateBotList), 10);
- requestURL(waterfallURL, updateBotList);
+
+ // XHR from onload winds up blocking the load, so we put it in a setTimeout.
+ window.setTimeout(requestURL, 0, waterfallURL, updateBotList);
}
+
+function toggle_size() {
+ if (document.body.className == "big") {
+ document.body.className = "small";
+ } else {
+ document.body.className = "big";
+ }
+}
+
</script>
<style>
body {
font: menu;
- width: 200px;
- background-color: #dddddd;
overflow: hidden;
}
+body.big .bot {
+ -webkit-transition: all .5s ease-out;
+ padding-right: 100px;
+}
+
+body.small .bot{
+ -webkit-transition: all .5s ease-out;
+ padding-right: 3px;
+}
+
.bot {
cursor: pointer;
-webkit-border-radius: 5px;
margin-top: 1px;
padding: 3px;
+ white-space: nowrap;
}
.bot:hover {
@@ -144,4 +163,7 @@ body {
border: 1px solid rgb(172, 160, 179);
}
</style>
+</head>
+<body onClick="toggle_size()">
<div id="bots">Loading....</div>
+</body> \ No newline at end of file