Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
build status for chromecast
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Sep 10, 2013
1 parent ea1b46b commit 52edfe2
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 0 deletions.
38 changes: 38 additions & 0 deletions yvonne/test-dashboard/buildbot-ajax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<link href="../../../polymer-elements/polymer-ajax/polymer-ajax.html" rel="import">
<polymer-element name="buildbot-ajax" extends="polymer-ajax" attributes="response builder" on-polymer-response="responseAction">
<script>
Polymer('buildbot-ajax', {
handleAs: 'json',
response: null,
builderChanged: function() {
if (this.builder) {
this.url = 'http://build.chromium.org/p/client.polymer/json/builders/' + this.builder + '/builds/-1';
this.go();
}
},
responseAction: function(e, response) {
console.log(response.response);
var result = {
success: response.response.results ? false : true,
browsers: []
};
var foundTest = false;
for (var i = 0, s; s = response.response.steps[i]; i++) {
if (foundTest) {
var match = String(s.text).match(/([a-zA-Z]+) ([0-9]+)/);
result.browsers.push({
browser: match[1],
version: match[2],
success: s.results[0] ? false : true
});
}
if (s.name === 'test') {
foundTest = true;
}
}
this.response = result;
console.log(this.response);
}
});
</script>
</polymer-element>
12 changes: 12 additions & 0 deletions yvonne/test-dashboard/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head>
<link href="test-dashboard.html" rel="import">
<script src="../../../polymer/polymer.js"></script>
<link href="../../../polymer-ui-elements/basic.css" rel="stylesheet">
</head>
<body class="polymer-ui-body-text">
<h1>Polymer!</h1>
<test-dashboard></test-dashboard>
</body>
</html>
27 changes: 27 additions & 0 deletions yvonne/test-dashboard/test-dashboard-cell.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<link href="../../../polymer-elements/polymer-flex-layout/polymer-flex-layout.html" rel="import">
<link href="buildbot-ajax.html" rel="import">
<polymer-element name="test-dashboard-cell" attributes="builder response">
<template>
<style>
span {
background-color: #e88;
border-radius: 3px;
margin: 1px;
padding: 3px 10px;
}
span.passed {
background-color: #8d4;
}
</style>
<buildbot-ajax builder="{{builder}}" response="{{response}}"></buildbot-ajax>
<template repeat="{{browser in response.browsers}}">
<span class="{{passed: browser.success}}">{{browser.browser}} {{browser.version}}</span>
</template>
<template if="{{!response.success && response.browsers.length == 0}}">
<span>failing :(</span>
</template>
</template>
<script>
Polymer('test-dashboard-cell');
</script>
</polymer-element>
27 changes: 27 additions & 0 deletions yvonne/test-dashboard/test-dashboard-row.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<link href="../../../polymer-elements/polymer-flex-layout/polymer-flex-layout.html" rel="import">
<link href="test-dashboard-cell.html" rel="import">
<polymer-element name="test-dashboard-row" attributes="project">
<template>
<style>
:host {
display: block;
margin: 5px;
}
.label {
display: inline-block;
width: 160px;
background-color: #eee;
padding: 3px 10px;
}
</style>
<div class="label">{{project}}</div>
<template repeat="{{plat in platforms}}">
{{plat}} <test-dashboard-cell builder="{{project}} {{plat}}"></test-dashboard-cell>
</template>
</template>
<script>
Polymer('test-dashboard-row', {
platforms: ['Mac', 'Win', 'Linux']
});
</script>
</polymer-element>
26 changes: 26 additions & 0 deletions yvonne/test-dashboard/test-dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<link href="test-dashboard-row.html" rel="import">
<polymer-element name="test-dashboard" attributes="projects">
<template>
<template repeat="{{projects}}">
<test-dashboard-row project="{{}}"></test-dashboard-row>
</template>
</template>
<script>
Polymer('test-dashboard', {
projects: [
'polymer',
'platform',
'CustomElements',
'HTMLImports',
'ShadowDOM',
'TemplateBinding',
'NodeBind',
'observe-js',
'polymer-expressions',
'PointerEvents',
'PointerGestures',
// 'WeakMap'
]
});
</script>
</polymer-element>

0 comments on commit 52edfe2

Please sign in to comment.