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

Commit 52edfe2

Browse files
author
Yvonne Yip
committed
build status for chromecast
1 parent ea1b46b commit 52edfe2

5 files changed

Lines changed: 130 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<link href="../../../polymer-elements/polymer-ajax/polymer-ajax.html" rel="import">
2+
<polymer-element name="buildbot-ajax" extends="polymer-ajax" attributes="response builder" on-polymer-response="responseAction">
3+
<script>
4+
Polymer('buildbot-ajax', {
5+
handleAs: 'json',
6+
response: null,
7+
builderChanged: function() {
8+
if (this.builder) {
9+
this.url = 'http://build.chromium.org/p/client.polymer/json/builders/' + this.builder + '/builds/-1';
10+
this.go();
11+
}
12+
},
13+
responseAction: function(e, response) {
14+
console.log(response.response);
15+
var result = {
16+
success: response.response.results ? false : true,
17+
browsers: []
18+
};
19+
var foundTest = false;
20+
for (var i = 0, s; s = response.response.steps[i]; i++) {
21+
if (foundTest) {
22+
var match = String(s.text).match(/([a-zA-Z]+) ([0-9]+)/);
23+
result.browsers.push({
24+
browser: match[1],
25+
version: match[2],
26+
success: s.results[0] ? false : true
27+
});
28+
}
29+
if (s.name === 'test') {
30+
foundTest = true;
31+
}
32+
}
33+
this.response = result;
34+
console.log(this.response);
35+
}
36+
});
37+
</script>
38+
</polymer-element>

yvonne/test-dashboard/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<link href="test-dashboard.html" rel="import">
5+
<script src="../../../polymer/polymer.js"></script>
6+
<link href="../../../polymer-ui-elements/basic.css" rel="stylesheet">
7+
</head>
8+
<body class="polymer-ui-body-text">
9+
<h1>Polymer!</h1>
10+
<test-dashboard></test-dashboard>
11+
</body>
12+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<link href="../../../polymer-elements/polymer-flex-layout/polymer-flex-layout.html" rel="import">
2+
<link href="buildbot-ajax.html" rel="import">
3+
<polymer-element name="test-dashboard-cell" attributes="builder response">
4+
<template>
5+
<style>
6+
span {
7+
background-color: #e88;
8+
border-radius: 3px;
9+
margin: 1px;
10+
padding: 3px 10px;
11+
}
12+
span.passed {
13+
background-color: #8d4;
14+
}
15+
</style>
16+
<buildbot-ajax builder="{{builder}}" response="{{response}}"></buildbot-ajax>
17+
<template repeat="{{browser in response.browsers}}">
18+
<span class="{{passed: browser.success}}">{{browser.browser}} {{browser.version}}</span>
19+
</template>
20+
<template if="{{!response.success && response.browsers.length == 0}}">
21+
<span>failing :(</span>
22+
</template>
23+
</template>
24+
<script>
25+
Polymer('test-dashboard-cell');
26+
</script>
27+
</polymer-element>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<link href="../../../polymer-elements/polymer-flex-layout/polymer-flex-layout.html" rel="import">
2+
<link href="test-dashboard-cell.html" rel="import">
3+
<polymer-element name="test-dashboard-row" attributes="project">
4+
<template>
5+
<style>
6+
:host {
7+
display: block;
8+
margin: 5px;
9+
}
10+
.label {
11+
display: inline-block;
12+
width: 160px;
13+
background-color: #eee;
14+
padding: 3px 10px;
15+
}
16+
</style>
17+
<div class="label">{{project}}</div>
18+
<template repeat="{{plat in platforms}}">
19+
{{plat}} <test-dashboard-cell builder="{{project}} {{plat}}"></test-dashboard-cell>
20+
</template>
21+
</template>
22+
<script>
23+
Polymer('test-dashboard-row', {
24+
platforms: ['Mac', 'Win', 'Linux']
25+
});
26+
</script>
27+
</polymer-element>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<link href="test-dashboard-row.html" rel="import">
2+
<polymer-element name="test-dashboard" attributes="projects">
3+
<template>
4+
<template repeat="{{projects}}">
5+
<test-dashboard-row project="{{}}"></test-dashboard-row>
6+
</template>
7+
</template>
8+
<script>
9+
Polymer('test-dashboard', {
10+
projects: [
11+
'polymer',
12+
'platform',
13+
'CustomElements',
14+
'HTMLImports',
15+
'ShadowDOM',
16+
'TemplateBinding',
17+
'NodeBind',
18+
'observe-js',
19+
'polymer-expressions',
20+
'PointerEvents',
21+
'PointerGestures',
22+
// 'WeakMap'
23+
]
24+
});
25+
</script>
26+
</polymer-element>

0 commit comments

Comments
 (0)