summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 22:06:30 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 22:06:30 +0000
commit706ab7f69fe1f8bd46d3341bf2709a93664c724d (patch)
treedbde1343223b6cb6158e85fc33d23db6dd6e58eb /chrome
parent4aeb7241340bb385b064ec3b1432987bad62db5d (diff)
downloadchromium_src-706ab7f69fe1f8bd46d3341bf2709a93664c724d.zip
chromium_src-706ab7f69fe1f8bd46d3341bf2709a93664c724d.tar.gz
chromium_src-706ab7f69fe1f8bd46d3341bf2709a93664c724d.tar.bz2
Various updates to the buildbot sample.
BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20552 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/data/extensions/samples/buildbot/buildbot.html43
-rw-r--r--chrome/test/data/extensions/samples/buildbot/manifest.json10
2 files changed, 32 insertions, 21 deletions
diff --git a/chrome/test/data/extensions/samples/buildbot/buildbot.html b/chrome/test/data/extensions/samples/buildbot/buildbot.html
index 4e20ea4..68f7a79 100644
--- a/chrome/test/data/extensions/samples/buildbot/buildbot.html
+++ b/chrome/test/data/extensions/samples/buildbot/buildbot.html
@@ -1,7 +1,6 @@
<script>
var botRoot = "http://build.chromium.org/buildbot/waterfall";
var statusURL = "http://chromium-status.appspot.com/current";
-//var waterfallURL = botRoot + "/console_json?name=username@chromium.org&json=1";
var waterfallURL = botRoot + "/console_json?json=1";
var botList;
var checkinResults;
@@ -25,6 +24,10 @@ function updateStatus(text) {
}
function updateBots(text) {
+ // There's a bug with the buildbot output where this quote is in the wrong
+ // place.
+ text = text.replace("'{revision':", "{'revision':");
+
var results = (new RegExp('(.*)<\/body>', 'g')).exec(text);
if (!results || results.index < 0) {
console.log("Error: couldn't find bot JSON");
@@ -51,8 +54,6 @@ function updateBots(text) {
function showBot(botIndex) {
var bot = botList[botIndex];
var url = botRoot + "/waterfall?builder=" + bot.name;
- //var url = botRoot + "/builders/" + bot.name;
- //var url = botRoot + "/" + bot.url;
window.open(url);
window.event.stopPropagation();
}
@@ -66,7 +67,7 @@ function displayBots() {
var html = "";
if (bots.className == "visible") {
botList.forEach(function(bot, i) {
- html += "<div class='bot " + bot.color +
+ html += "<div class='bot " + bot.color +
"' onclick='showBot(" + i + ")' " +
"title='" + bot.title + "'></div>";
});
@@ -89,12 +90,12 @@ function requestURL(url, callback) {
callback(text);
}
}
-
+
xhr.onerror = function(error) {
console.log("xhr error: " + error);
}
- xhr.open("GET", url);
+ xhr.open("GET", url, true);
xhr.send({});
} catch(e) {
console.log("exception: " + e);
@@ -129,7 +130,6 @@ window.addEventListener("mouseout", function(e) {
hideTimerId = null;
var bots = document.getElementById("bots");
bots.className = "";
- //displayBots();
}, 1000);
}
}, false);
@@ -138,7 +138,11 @@ window.addEventListener("click", function() {
window.open(botRoot);
}, false);
-requestStatus();
+window.onload = function() {
+ // This is weird, but somehow doing an XHR -- even though it is
+ // asynchronous!! -- in onload delays the initial render from happening.
+ window.setTimeout(requestStatus, 10);
+}
</script>
<style>
@@ -159,31 +163,36 @@ requestStatus();
}
#bots {
- border: none;
height: 100%;
- width: 0;
+ /* We would rather this be zero, but a rendering bug in WebKit causes the
+ offset width of the document to sometimes be caluculated incorrectly that
+ way. */
+ width: 1px;
-webkit-transition: width .2s linear;
- background-color: transparent;
display:-webkit-box;
-webkit-box-align:center; /* center content vertically */
overflow: hidden;
- padding-left: 2px;
}
#bots.visible {
- width: 612px; /* hardcoded width sucks */
+ width:470px;
}
.bot {
- margin-right: 1px;
line-height: 100%;
cursor: pointer;
-webkit-border-radius: 2px;
display:-webkit-box;
- width: 10px;
+ width: 6px;
height: 15px;
}
+.bot:first-child {
+ /* Since #bots is 1px wide, this is necessary so that we don't show the first
+ pixel of the first bot. */
+ margin-left:1px;
+}
+
.running {
background-color: rgb(255, 252, 108);
border: 1px solid rgb(197, 197, 109);
@@ -217,7 +226,9 @@ requestStatus();
</style>
<div class="toolstrip-button">
-<span id="status" class="open">tree: open?</span>
+ <span id="status" class="open">
+ <span style="color:#ff6600">loading...</span>
+ </span>
</div>
<div id="bots">
</div>
diff --git a/chrome/test/data/extensions/samples/buildbot/manifest.json b/chrome/test/data/extensions/samples/buildbot/manifest.json
index 71e2326..17ee4e4 100644
--- a/chrome/test/data/extensions/samples/buildbot/manifest.json
+++ b/chrome/test/data/extensions/samples/buildbot/manifest.json
@@ -1,8 +1,8 @@
{
- "description": "Buildbot waterfall monitor",
- "name": "buildbot",
+ "name": "Chromium Buildbot Monitor",
+ "version": "0.2",
+ "description": "Displays the status of the Chromium buildbot in the extension toolstrip. On hover, expands to give more detail about each bot.",
"toolstrips": [
"buildbot.html"
- ],
- "version": "0.1"
-} \ No newline at end of file
+ ]
+}