Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1026)

Unified Diff: tests/test_console_merger_splitrevs/surroundings_input.html

Issue 11535002: chromium-build app now renders console from stored rows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chromium-build
Patch Set: Add test_parse_master_utf8 Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/test_console_merger_splitrevs/surroundings_input.html
diff --git a/tests/test_console_merger_splitrevs/surroundings_input.html b/tests/test_console_merger_splitrevs/surroundings_input.html
new file mode 100644
index 0000000000000000000000000000000000000000..a4b494698d36bc5d42991c24381da0d76d2002d0
--- /dev/null
+++ b/tests/test_console_merger_splitrevs/surroundings_input.html
@@ -0,0 +1,815 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>BuildBot: Chromium</title>
+<link rel="stylesheet" href="default.css" type="text/css" />
+<script type="text/javascript">
+// <![CDATA[
+//
+
+//
+// Functions used to display the build status bubble on box click.
+//
+
+// show the build status box. This is called when the user clicks on a block.
+function showBuildBox(url, event) {
+ // Find the current curson position.
+ var cursorPosTop = (window.event ? window.event.clientY : event.pageY)
+ var cursorPosLeft = (window.event ? window.event.clientX : event.pageX)
+
+ // Offset the position by 5, to make the window appears under the cursor.
+ cursorPosTop = cursorPosTop + document.body.scrollTop -5 ;
+ cursorPosLeft = cursorPosLeft + document.body.scrollLeft - 5;
+
+ // Move the div (hidden) under the cursor.
+ var divBox = document.getElementById('divBox');
+ divBox.style.top = parseInt(cursorPosTop) + 'px';
+ divBox.style.left = parseInt(cursorPosLeft) + 'px';
+
+ // Reload the hidden frame with the build page we want to show.
+ // The onload even on this frame will update the div and make it visible.
+ document.getElementById("frameBox").src = url
+
+ // We don't want to reload the page.
+ return false;
+}
+
+// OnLoad handler for the iframe containing the build to show.
+function updateDiv(event) {
+ // Get the frame innerHTML.
+ var iframeContent = document.getElementById("frameBox").contentWindow.document.body.innerHTML;
+
+ // If there is any content, update the div, and make it visible.
+ if (iframeContent) {
+ var divBox = document.getElementById('divBox');
+ divBox.innerHTML = iframeContent ;
+ divBox.style.display = "block";
+ }
+}
+
+// Util functions to know if an element is contained inside another element.
+// We use this to know when we mouse out our build status div.
+function containsDOM (container, containee) {
+ var isParent = false;
+ do {
+ if ((isParent = container == containee))
+ break;
+ containee = containee.parentNode;
+ } while (containee != null);
+
+ return isParent;
+}
+
+// OnMouseOut handler. Returns true if the mouse moved out of the element.
+// It is false if the mouse is still in the element, but in a blank part of it,
+// like in an empty table cell.
+function checkMouseLeave(element, event) {
+ if (element.contains && event.toElement) {
+ return !element.contains(event.toElement);
+ }
+ else if (event.relatedTarget) {
+ return !containsDOM(element, event.relatedTarget);
+ }
+}
+
+// Creates a new cookie.
+function createCookie(name, value, day) {
+ var date = new Date();
+ date.setTime(date.getTime() + (day * 24 * 60 * 60 * 1000));
+ var expires = "; expires=" + date.toGMTString();
+ document.cookie = name + "=" + value+expires + "; path=/";
+}
+
+// Returns the vaue of a cookie, or null if it does not exist.
+function readCookie(name) {
+ var begin = name + "=";
+ var data = document.cookie.split(';');
+ for(var i = 0; i < data.length; i++) {
+ var cookie = data[i];
+ while (cookie.charAt(0) == ' ')
+ cookie = cookie.substring(1, cookie.length);
+ if (cookie.indexOf(begin) == 0)
+ return cookie.substring(begin.length, cookie.length);
+ }
+
+ return null;
+}
+
+// Deletes a cookie.
+function eraseCookie(name) {
+ createCookie(name, "", -1);
+}
+
+// Hides all "details" and "comments" section.
+function collapse() {
+ // Hide all Comments sections.
+ var comments = document.querySelectorAll('.DevComment');
+ for(var i = 0; i < comments.length; i++) {
+ comments[i].style.display = "none";
+ }
+
+ // Hide all details sections.
+ var details = document.querySelectorAll('.DevDetails');
+ for(var i = 0; i < details.length; i++) {
+ details[i].style.display = "none";
+ }
+
+ // Fix the rounding on the Revision box. (Lower right corner must be round)
+ var revisions = document.querySelectorAll('.DevRev');
+ for(var i = 0; i < revisions.length; i++) {
+ revisions[i].className = revisions[i].className + ' DevRevCollapse';
+ }
+
+ // Fix the rounding on the last category box. (Lower left corner must be round)
+ var status = document.querySelectorAll('.last');
+ for(var i = 0; i < status.length; i++) {
+ status[i].className = status[i].className + ' DevStatusCollapse';
+ }
+
+ // Create a cookie to remember that we want the view to be collapsed.
+ createCookie('collapsed', 'true', 30)
+
+ // Hide the collapse and the unmerge buttons.
+ document.querySelectorAll('.collapse')[0].style.display = 'none'
+ document.querySelectorAll('.unmerge')[0].style.display = 'none'
+
+ // Activate the merge and expand buttons.
+ document.querySelectorAll('.uncollapse')[0].style.display = 'inline'
+ document.querySelectorAll('.merge')[0].style.display = 'inline'
+}
+
+// Expands the view. This is the opposite of "Collapse"
+function uncollapse() {
+ unmerge();
+
+ // Make the comments visible.
+ var comments = document.querySelectorAll('.DevComment');
+ for(var i = 0; i < comments.length; i++) {
+ comments[i].style.display = "";
+ }
+
+ // Make the details visible.
+ var details = document.querySelectorAll('.DevDetails');
+ for(var i = 0; i < details.length; i++) {
+ details[i].style.display = "";
+ }
+
+ // Remove the round corner (lower right) for the Revision box.
+ var revisions = document.querySelectorAll('.DevRev');
+ for(var i = 0; i < revisions.length; i++) {
+ revisions[i].className = revisions[i].className.replace('DevRevCollapse', '');
+ }
+
+ // Remoe the round corner (lower left) for the last category box.
+ var status = document.querySelectorAll('.DevStatus');
+ for(var i = 0; i < status.length; i++) {
+ status[i].className = status[i].className.replace('DevStatusCollapse', '');
+ }
+
+ // Delete the cookies that say that we want to be collapsed or merged.
+ eraseCookie('collapsed')
+ eraseCookie('merged')
+
+ // Display the "collapse" and "merge" buttons.
+ document.querySelectorAll('.collapse')[0].style.display = 'inline'
+ document.querySelectorAll('.merge')[0].style.display = 'inline'
+
+ // Remove the "uncollapse" and "unmerge" buttons.
+ document.querySelectorAll('.uncollapse')[0].style.display = 'none'
+ document.querySelectorAll('.unmerge')[0].style.display = 'none'
+}
+
+// Merge all the status boxes together.
+function merge() {
+ collapse();
+
+ // Hide all the spacing.
+ var spacing = document.querySelectorAll('.DevStatusSpacing');
+ for(var i = 0; i < spacing.length; i++) {
+ spacing[i].style.display = "none";
+ }
+
+ // Each boxes have, in the className, a tag that uniquely represents the
+ // build where this data comes from.
+ // Since we want to merge all the boxes coming from the same build, we
+ // parse the document to find all the builds, and then, for each build, we
+ // concatenate the boxes.
+
+ var allTags = [];
+ all = document.getElementsByTagName('*')
+ for(var i = 0; i < all.length; i++) {
+ var element = all[i];
+ start = element.className.indexOf('Tag')
+ if (start != -1) {
+ var className = ""
+ end = element.className.indexOf(' ', start)
+ if (end != -1) {
+ className = element.className.substring(start, end);
+ } else {
+ className = element.className.substring(start);
+ }
+ allTags[className] = 1;
+ }
+ }
+
+ // Mergeall tags that we found
+ for (i in allTags) {
+ var current = document.querySelectorAll('.' + i);
+
+ // We do the work only if there is more than 1 box with the same
+ // build.
+ if (current.length > 1) {
+ // Add the noround class to all the boxes.
+ for(var i = 0; i < current.length; i++) {
+ current[i].className = current[i].className + ' noround';
+ }
+
+ // Add the begin class to the first box.
+ current[0].className = current[0].className + ' begin';
+
+ // Add the end class to the last box.
+ last = current.length - 1;
+ current[last].className = current[last].className + ' end';
+ }
+ }
+
+ // Display the "unmerge" button.
+ document.querySelectorAll('.unmerge')[0].style.display = 'inline'
+ document.querySelectorAll('.uncollapse')[0].style.display = 'inline'
+
+ // Remove the "merge" button.
+ document.querySelectorAll('.collapse')[0].style.display = 'none'
+ document.querySelectorAll('.merge')[0].style.display = 'none'
+
+ // Create a cookie to remember that we want to be merged.
+ createCookie('merged', 'true', 30)
+}
+
+// Un-merge the view. This is the opposite of "merge".
+function unmerge() {
+ // We put back all the spacing.
+ var spacing = document.querySelectorAll('.DevStatusSpacing');
+ for(var i = 0; i < spacing.length; i++) {
+ spacing[i].style.display = "";
+ }
+
+ // We remove the class added to all the boxes we modified.
+ var noround = document.querySelectorAll('.noround');
+ for(var i = 0; i < noround.length; i++) {
+ noround[i].className = noround[i].className.replace("begin", '');
+ noround[i].className = noround[i].className.replace("end", '');
+ noround[i].className = noround[i].className.replace("noround", '');
+ }
+
+ // Delete the cookie, we don't want to be merged anymore.
+ eraseCookie('merged')
+
+ // Display the "merge" button.
+ document.querySelectorAll('.merge')[0].style.display = 'inline'
+
+ // Hide the "unmerge" button.
+ document.querySelectorAll('.unmerge')[0].style.display = 'none'
+}
+
+function SetupView() {
+ if (readCookie('merged')) {
+ merge();
+ } else if (readCookie('collapsed')) {
+ collapse();
+ }
+}
+
+document.addEventListener("DOMContentLoaded", SetupView, false);
+
+// ]]>
+</script>
+</head>
+<body class="interface">
+<div style="text-align:right; float: right;">
+<a href="https://www.google.com/accounts/ServiceLogin?service=ah&amp;passive=true&amp;continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttps://chromium-build.appspot.com/p/chromium/console&amp;ltmpl=gm&amp;shdf=ChoLEgZhaG5hbWUaDkNocm9taXVtIEJ1aWxkDBICYWgiFHIv83J48VD3Mlzg3YybgIqpV0R7KAEyFGspkZghorlGKUZfUAeY_oik8mCU">Sign In</a>
+</div>
+<div class="header">
+<a href="http://build.chromium.org/p/chromium/.">Home</a>
+ - <a href="http://build.chromium.org/p/chromium/waterfall">Waterfall</a>
+ - <a href="http://build.chromium.org/p/chromium/console">Console</a>
+ - <a href="http://build.chromium.org/p/chromium/builders">Builders</a>
+ - <a href="http://build.chromium.org/p/chromium/one_line_per_build">Recent Builds</a>
+ - <a href="http://build.chromium.org/p/chromium/buildslaves">Buildslaves</a>
+ - <a href="http://build.chromium.org/p/chromium/changes">Changesources</a>
+ - <a href="http://build.chromium.org/p/chromium/json/help">JSON API</a>
+ - <a href="http://build.chromium.org/p/chromium/about">About</a>
+</div>
+<hr />
+<script>
+ /**
+ * Pseudo namespace for chromium - keep it short because we are in a very
+ * narrow scope for this file.
+ * @type {Object}
+ */
+ var c = {};
+
+ /**
+ * Replaces html references with anchor tags to the same.
+ * @param {String} className CSS class to operate on.
+ */
+ function autoLink(className) {
+ var comments = document.querySelectorAll(className);
+ for(var i = 0; i < comments.length; i++) {
+ comments[i].innerHTML = comments[i].innerHTML.replace(
+ /https?:\/\/[^ \t\n<]*/g, '<a href="$&">$&</a>');
+ }
+ };
+
+ window.addEventListener("load", function() {
+ autoLink('.DevComment');
+ }, false);
+
+ /**
+ * This is the indicator for whether we are in console or waterfall
+ * mode, or some future resource.
+ * @type {String}
+ */
+ c.viewtype = location.pathname.split('/').slice(-1);
+
+ /**
+ * Returns a search string portion including marker, or an empty string.
+ * optional.
+ * @param {String} opt_s A search string, or some form of emptiness.
+ * @returns {!String}
+ */
+ function search(opt_s) {
+ return opt_s ? '?' + opt_s.replace(/^[?]/, '') : '';
+ };
+
+ /**
+ * Replicates a string.
+ * @param {Number} i A whole number of repetitions.
+ * @param {String} x The string to be repeated.
+ * @returns {!String}
+ */
+ function repeat(i, x){
+ var t = ''
+ for (j = 0; j < i; j++) { t += x; }
+ return t;
+ };
+
+ /**
+ * A simple HTML table string.
+ * @param {String} attributes A set of HTML attributes for the table.
+ * @param {String} contents The contents.
+ * @returns {!String}
+ */
+ function table(attributes, contents) {
+ return '<table ' + attributes + '>' + contents + '</table>\n';
+ };
+
+ /**
+ * A simple HTML div string.
+ * @param {String} attributes A set of HTML attributes for the div.
+ * @param {String} contents The contents.
+ * @returns {!String}
+ */
+ function div(attributes, contents) {
+ return '<div ' + attributes + '>' + contents + '</div>';
+ };
+
+ /**
+ * A simple HTML table row string.
+ * @param {String} attributes A set of HTML attributes for the table row.
+ * @param {String} contents The contents.
+ * @returns {!String}
+ */
+ function tr(contents) {
+ return '<tr>' + contents + '</tr>\n';
+ };
+
+ /**
+ * A simple HTML table cell string.
+ * @param {String} attributes A set of HTML attributes for the table cell.
+ * @param {String} contents The contents.
+ * @returns {!String}
+ */
+ function td(attributes, contents) {
+ return '<td ' + attributes + '>' + contents + '</td>';
+ };
+
+ /**
+ * A simple HTML anchor string.
+ * @param {String} url The value for the href.
+ * @param {String} attributes A set of HTML attributes for the table.
+ * @param {String} contents The contents.
+ * @returns {!String}
+ */
+ function a(url, contents, attributes) {
+ return '<a ' + attributes + ' href="' + url + '">' + contents + '</a>';
+ };
+
+ /**
+ * Gives an HTML anchor string to the specified URL, but of the same view
+ * type as the current page.
+ * @param {String} url The URL portion up to the view.
+ * @param {String} search_opt A the query portion.
+ * @param {String} contents The contents for the tag.
+ * @returns {!String}
+ */
+ function aView(url, search_opt, contents) {
+ return a((url ? url + '/' : '') + c.viewtype + search(search_opt),
+ contents, '')
+ };
+
+ /**
+ * A simple HTML iframe string.
+ * @param {String} attributes A set of HTML attributes for the table.
+ * @param {String} url The source of the iframe.
+ * @returns {!String} the iframe or an empty string if noframe is specified.
+ */
+ function iFrame(attributes, url) {
+ if (window.location.href.search('noframe') == -1) {
+ return '<iframe ' + attributes + ' src="' + url + '"></iframe>';
+ }
+ return ''
+ };
+</script>
+<div class="Announcement">
+<iframe width="100%" height="44" frameborder="0" scrolling="no" src="https://chromium-build.appspot.com/p/chromium-status/current"></iframe>
+<center style="padding: 0 7px">
+<table width="100%" valign="top" bgcolor="#efefef" style="-webkit-border-bottom-left-radius: 24px; -webkit-border-bottom-right-radius: 24px; -moz-border-bottom-right-radius: 24px; -moz-border-bottom-right-radius: 24px; box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6); -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6); -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);">
+<tr>
+<td width="29%">
+<table valign="top" width="100%">
+<tr>
+<td style="text-align: right;">
+<b>Builds:</b>
+</td>
+<td>
+<a href="http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html">continuous</a> |
+ <a href="http://build.chromium.org/f/chromium/symsrv/index.html">symbols</a> |
+ <a href="http://chromium-status.appspot.com">status</a>
+</td>
+</tr>
+<tr>
+<td style="text-align: right;">
+<b>Dashboards:</b>
+</td>
+<td>
+<a href="http://build.chromium.org/f/chromium/perf/dashboard/overview.html">perf</a> |
+ <a href="http://build.chromium.org/f/chromium/perf/dashboard/memory.html">memory</a> |
+ <a href="http://build.chromium.org/f/chromium/perf/dashboard/sizes.html">sizes</a> |
+ <a href="http://build.chromium.org/f/chromium/coverage/">coverage</a> |
+ <a href="http://build.chromium.org/f/chromium/flakiness/">flakiness</a> |
+ <a href="http://build.chromium.org/p/chromium/stats">stats</a>
+</td>
+</tr>
+<tr>
+<td style="text-align: right;">
+<b>Chromium:</b>
+</td>
+<td>
+<a href="http://src.chromium.org/viewvc/chrome">sources</a> |
+ <a href="http://codereview.chromium.org/">reviews</a> |
+ <a href="http://code.google.com/p/chromium/issues/list?can=2&amp;q=&amp;sort=pri+mstone&amp;colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone">bugs</a> |
+ <a href="http://dev.chromium.org/Home">dev</a> |
+ <a href="http://www.google.com/support/chrome/">support</a>
+</td>
+</tr>
+<tr>
+<td style="text-align: right;">
+<b>Sheriffs:</b>
+</td>
+<td>
+<script>document.write('miket, perkj, vtl')</script>,<br />
+<script>document.write('eugenis')</script>(Memory),
+ <script>document.write('mseaborn')</script>(NaCl),<br />
+<script>document.write('kerz')</script>(Perf),
+ <script>document.write('ferringb, adlr')</script>,
+ <script>document.write('petkov')</script>(CrOS),<br />
+<script>document.write('pliard')</script>(Android),
+ <script>document.write('droger')</script>,
+ <script>document.write('lliabraa')</script>(iOS),<br />
+<script>document.write('None (channel is sheriff)')</script>(GPU),<br />
+<a href="https://www.google.com/calendar/render?cid=google.com_iqfka4i9asiva67vlqqf1es094%40group.calendar.google.com">trooper schedule</a>
+</td>
+</tr>
+<tr>
+<td style="text-align: right;">
+<b>Gardeners:</b>
+</td>
+<td>
+<script>document.write('eae, podivilov')</script>(WebKit),
+ <script>document.write('None (channel is sheriff)')</script>
+ (<a href="http://dev.chromium.org/developers/tree-sheriffs/chrome-in-chromeos-gardening">ChromeOS</a>)
+ </td>
+</tr>
+<tr>
+<td style="text-align: right;">
+<b>Masters:</b>
+</td>
+<td colspan="2">
+<script>
+ document.write([
+ a("http://build.chromium.org/p/chromium/../tryserver.chromium/waterfall", "tryserver.chromium", ""),
+ aView("http://build.chromium.org/p/chromium/../chromium.fyi", "", "chromium.fyi"),
+ aView("http://build.chromium.org/p/chromium/../chromium.memory", "", "chromium.memory"),
+ aView("http://build.chromium.org/p/chromium/../chromium.memory.fyi", "", "chromium.memory.fyi"),
+ aView("http://build.chromium.org/p/chromium/../chromium.chromiumos", "", "chromium.chromiumos"),
+ aView("http://build.chromium.org/p/chromium/../chromiumos", "", "chromiumos"),
+ aView("http://build.chromium.org/p/chromium/../client.nacl", "", "client.nacl"),
+ aView("http://build.chromium.org/p/chromium/../chromium.webkit", "", "chromium.webkit")].join(' | '));
+ </script>
+</td>
+</tr>
+<tr>
+<td style="text-align: right;">
+<b>Navigate:</b>
+</td>
+<td colspan="2">
+<script>
+ document.write([
+ a("http://dev.chromium.org/developers/testing/chromium-build-infrastructure/tour-of-the-chromium-buildbot", "about", ""),
+ a("http://build.chromium.org/p/chromium/waterfall/help", "customize", ""),
+ a("http://build.chromium.org/p/chromium/waterfall", "waterfall", ""),
+ a("http://build.chromium.org/p/chromium/console", "console", ""),
+ a("http://build.chromium.org/p/chromium/waterfall?show_events=true&failures_only=true", "failures", "")].join(' | '));
+ </script>
+</td>
+</tr>
+</table>
+</td>
+<td width="1" bgcolor="#CCCCCC">
+</td>
+<td width="1%">
+</td>
+<td width="70%">
+<table width="100%">
+<script language="javascript">
+ c.chromium = '';
+ c.win = '';
+ c.mac = '';
+ c.linux = '';
+ c.chromium_chromiumos = '';
+ c.memory = '';
+ c.memory_fyi = '';
+ c.perf = '';
+ c.cros = '';
+ c.chrome = '';
+ c.lkgr = '';
+ c.gpu = '';
+ c.gpu_fyi = '';
+
+ c.status = 'http://build.chromium.org/p/chromium/../chromium';
+ c.status_win = 'http://build.chromium.org/p/chromium/../chromium.win';
+ c.status_mac = 'http://build.chromium.org/p/chromium/../chromium.mac';
+ c.status_linux = 'http://build.chromium.org/p/chromium/../chromium.linux';
+ c.status_cros = 'http://build.chromium.org/p/chromium/../chromium.chromiumos';
+ c.status_memory = 'http://build.chromium.org/p/chromium/../chromium.memory';
+ c.status_memory_fyi = 'http://build.chromium.org/p/chromium/../chromium.memory.fyi';
+ c.status_chrome = 'http://build.chromium.org/p/chromium/../chromium.chrome';
+ c.status_perf = 'http://build.chromium.org/p/chromium/../chromium.perf';
+ c.status_lkgr = 'http://build.chromium.org/p/chromium/../chromium.lkgr';
+ c.status_gpu = 'http://build.chromium.org/p/chromium/../chromium.gpu';
+ c.status_gpu_fyi = 'http://build.chromium.org/p/chromium/../chromium.gpu.fyi';
+
+ /**
+ * Builds a reference for the iframe with boxes.
+ * @param {String} x the name of the waterfall.
+ * @returns {String} The URL.
+ */
+ function BarUrl(x) {
+ return 'https://chromium-build.appspot.com/p/' + x +
+ '/horizontal_one_box_per_builder';
+ }
+ c.bar = BarUrl('chromium')
+ c.bar_win = BarUrl('chromium.win');
+ c.bar_mac = BarUrl('chromium.mac');
+ c.bar_linux = BarUrl('chromium.linux');
+ c.bar_memory = BarUrl('chromium.memory');
+ c.bar_memory_fyi = BarUrl('chromium.memory.fyi');
+ c.bar_perf = BarUrl('chromium.perf');
+ c.bar_chrome = BarUrl('chromium.chrome');
+ c.bar_lkgr = BarUrl('chromium.lkgr');
+ c.bar_cros = BarUrl('chromium.chromiumos');
+ c.bar_gpu = BarUrl('chromium.gpu');
+ c.bar_gpu_fyi = BarUrl('chromium.gpu.fyi');
+
+
+ /**
+ * Joins URL and search terms.
+ * @param {String} type The Url without the cgi search portion.
+ * @param {String} content The parameters for the sub-selection
+ * inside the master. Optional.
+ * @returns {String} A completed URL.
+ */
+ function GetUrl(type, content) {
+ return type + search(content);
+ }
+
+ /**
+ * Callback to replace the LKGR link with one that identifies
+ * the current revision for the LKGR.
+ */
+ function DisplayLKGR() {
+ var xmlHttp = new XMLHttpRequest();
+ var lkgrPath = '/p/chromium.lkgr' +
+ '/json/builders/Linux%20x64/builds/-1/as_text=1.json';
+ var lkgrLink = document.getElementById('LKGRLink');
+ xmlHttp.open('GET', lkgrPath, false);
+ xmlHttp.send(null);
+ if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
+ var buildData;
+ if (typeof (JSON) !== 'undefined' &&
+ typeof (JSON.parse) === 'function') {
+ buildData = JSON.parse(xmlHttp.responseText);
+ } else {
+ buildData = eval('(' + xmlHttp.responseText + ')');
+ }
+ var properties = buildData['properties'];
+ for (var i = 0; i < properties.length; i++) {
+ if (properties[i][0] == 'got_revision') {
+ lkgrLink.innerHTML = 'LKGR<br>(' + properties[i][1] + ')';
+ return;
+ }
+ }
+ }
+ }
+
+ c.default_iframe_properties = [
+ 'width="100%"',
+ 'height="20"',
+ 'frameborder="0"',
+ 'scrolling="no"',
+ ].join(' ');
+
+ /**
+ * The most detailed specification of a builder bar with boxes.
+ * Reutrns an HTMLstring with 2 <td>s
+ * @param {String} status_url URL portion for the title link.
+ * @param {String} bar_url URL portion for the array of boxes.
+ * @param {String} content specification for the references, e.g..
+ * @param {String} name what to call this bar.
+ * @param {String} bar_properties extra attributes for the array
+ * of boxes portion.
+ * @param {String} link_properties extra attributes for the name
+ * portion that is a link.
+ * @returns {String}
+ */
+ function HTMLBaseBar(status_url, bar_url, content, name,
+ bar_properties, link_properties) {
+ return td('',
+ a(GetUrl(status_url, content), name,
+ link_properties)) +
+ td(bar_properties,
+ iFrame(c.default_iframe_properties,
+ GetUrl(bar_url, content)));
+ }
+
+ /**
+ * The more common specification of a builder bar with boxes.
+ * Presume to take an entire row.
+ * @param {String} status_url URL portion for the title link.
+ * @param {String} bar_url URL portion for the array of boxes.
+ * @param {String} content specification for the references, e.g..
+ * @param {String} name what to call this bar.
+ * @returns {String}
+ */
+ function HTMLBar(status_url, bar_url, content, name) {
+ return tr(HTMLBaseBar(status_url, bar_url, content, name,
+ 'width="99%" colspan=9', ''));
+ }
+
+ /**
+ * A specification of a builder bar with boxes, which is one of
+ * multiple in a row.
+ * Note that since these are elements of a table, percents
+ * can be irrelevant to the final layout.
+ * @param {String} status_url URL portion for the title link.
+ * @param {String} bar_url URL portion for the array of boxes.
+ * @param {String} content specification for the references, e.g..
+ * @param {String} name what to call this bar.
+ * @param {String} pc percent of the line to allocat to the boxes.
+ * @returns {String}
+ */
+ function HTMLSubBar(status_url, bar_url, content, name, pc) {
+ return HTMLBaseBar(status_url, bar_url, content, name,
+ 'width="' + pc + '"', '');
+ }
+
+ document.write(tr(td(
+ 'colspan=10 width="99%"',
+ div(
+ 'class="closerbox" width="100%"',
+ div('class="title" width="100%" height="10px"',
+ a('http://chromium-status.appspot.com', 'Tree closers')) +
+ table(
+ 'width="100%"',
+ tr(
+ HTMLBaseBar(c.status, c.bar, c.chromium, 'Chromium',
+ 'width="8%"') +
+ HTMLBaseBar(c.status_win, c.bar_win, c.win, 'Win',
+ 'width="42%"') +
+ HTMLBaseBar(c.status_mac, c.bar_mac, c.mac, 'Mac',
+ 'width="30%"') +
+ HTMLBaseBar(c.status_linux, c.bar_linux, c.linux,
+ 'Linux', 'width="20%"')) +
+ tr(HTMLBaseBar(c.status_cros, c.bar_cros, c.cros,
+ 'ChromiumOS', 'width="50%" colspan=3') +
+ HTMLSubBar(c.status_chrome, c.bar_chrome, c.chrome,
+ 'Official', '30%') +
+ HTMLSubBar(c.status_memory, c.bar_memory, c.memory,
+ 'Memory', '20%')))))));
+
+ document.write(tr(
+ HTMLBaseBar(c.status_lkgr, c.bar_lkgr, c.lkgr,
+ 'LKGR', 'width="25%"', 'id="LKGRLink"') +
+ HTMLBaseBar(c.status_perf, c.bar_perf, c.perf,
+ 'Perf', 'width="75%" colspan=5', '')));
+
+ document.write(tr(
+ HTMLBaseBar(c.status_memory_fyi, c.bar_memory_fyi, c.memory_fyi,
+ 'Memory<br>FYI', 'width="100%" colspan=6', '')));
+
+ document.write(tr(
+ HTMLBaseBar(c.status_gpu, c.bar_gpu, c.gpu,
+ 'GPU', 'width="80%"', '') +
+ HTMLBaseBar(c.status_gpu_fyi, c.bar_gpu_fyi, c.gpu_fyi,
+ 'GPU FYI', 'width="20%" colspan=5', '')));
+
+ setTimeout('DisplayLKGR()', 100);
+ </script>
+</table>
+</td>
+</tr>
+</table>
+</center>
+</div>
+<hr />
+<div class="content">
+<div align="center">
+<table width="95%" class="Grid" border="0" cellspacing="0">
+<tr>
+<td width="33%" align="left" class="left_align">
+</td>
+<td width="33%" align="center" class="center_align">
+<div align="center">
+<table class="info">
+<tr>
+<td>Legend:&nbsp;&nbsp;</td>
+<td class="legend success" title="All tests passed">Passed</td>
+<td class="legend failure" title="There is a new failure. Take a look!">Failed</td>
+<td class="legend warnings" title="It was failing before, and it is still failing. Make sure you did not introduce new regressions">Failed&nbsp;Again</td>
+<td class="legend running" title="The tests are still running">Running</td>
+<td class="legend exception" title="Something went wrong with the test, there is no result">Exception</td>
+<td class="legend offline" title="The builder is offline, as there are no slaves connected to it">Offline</td>
+<td class="legend notstarted" title="No result yet.">No&nbsp;data</td>
+</tr>
+</table>
+</div>
+</td>
+<td width="33%" align="right" class="right_align">
+<script type="text/javascript">
+// <![CDATA[
+ function reload_page() {
+ name_value = document.getElementById('namebox').value
+ if (document.location.href.lastIndexOf('?') == -1)
+ document.location.href = document.location.href+ '?name=' + name_value;
+ else
+ document.location.href = document.location.href+ '&name=' + name_value;
+ }
+// ]]>
+ </script>
+<!-- <input id='namebox' name='name' type='text' style='color:#999;'
+ onblur='this.value = this.value || this.defaultValue; this.style.color = "#999";'
+ onfocus='this.value=""; this.style.color = "#000";'
+ value='Personalized for...' />
+ <input type='submit' value='Go' onclick='reload_page()' /> -->
+</td>
+</tr>
+</table>
+</div>
+<br />
+<div align="center">
+<table width="96%" class="ConsoleData"><tr>
+</table>
+</div>
+<div id="divBox" onmouseout="if (checkMouseLeave(this, event)) this.style.display = 'None'" class="BuildWaterfall">
+</div>
+<iframe id="frameBox" style="display: none;"></iframe>
+<script type="text/javascript">
+// replace 'onload="updateDiv(event);" with this, as iframe doesn't have onload event in xhtml
+window.addEventListener("load", function() {
+ document.getElementById('frameBox').onload = function(event) {
+ updateDiv(event);
+ };
+}, false);
+</script>
+</div><div class="footer" style="clear:both">
+<hr />
+ [ <a class="collapse" href="#" onclick="collapse(); return false;">collapse</a>
+<a class="uncollapse" href="#" onclick="uncollapse(); return false;">un-collapse</a>
+<a class="merge" href="#" onclick="merge(); return false;">merge</a>
+<a class="unmerge" style="display: none" href="#" onclick="unmerge(); return false;">un-merge</a> ]
+ <p>Debug info: {'revision_final': 25, 'builds_scanned': 200, 'source_all': 25, 'source_len': 25, 'last_revision': u'171866', 'from_cache': 54, 'added_blocks': 0, 'load_time': 0.038244009017944336}</p>
+</div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698