Commit 01e21719 authored by abarth@chromium.org's avatar abarth@chromium.org

Start a top-down rewrite of Garden-O-Matic in Polymer

In previous CLs, we've been working up from the bottom of the widget hierarchy
to rewrite Garden-O-Matic in Polymer. This CL moves this project forward by
starting from the top of the widget hierarchy. When these two efforts meet in
the middle, we'll be done!

This CL is mostly about fleshing out the structure of the components. We'll
need to iterate on the visual style of each component in future CLs. I've added
dependencies on Polymer's core and paper elements because the core elements are
super useful and the paper elements are super pretty.

The top-down version is hosted in gom2.html to avoid breaking the working
product. Currently, gom2 shows correctly grouped sets of failing tests and the
regression ranges for each group (albeit without any fancy styling).

NOTRY=true

Review URL: https://codereview.chromium.org/345853005

git-svn-id: svn://svn.chromium.org/blink/trunk@177172 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8927e34a
{
"name": "garden-o-matic",
"dependencies": {
"polymer": "Polymer/polymer#~0.3.3"
}
"name": "garden-o-matic",
"dependencies": {
"polymer": "Polymer/polymer#~0.3.3",
"paper-elements": "Polymer/paper-elements#~0.3.3",
"core-elements": "Polymer/core-elements#~0.3.3"
}
}
......@@ -73,7 +73,9 @@ THE POSSIBILITY OF SUCH DAMAGE.
<script src="bower_components/platform/platform.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="polymer-load-warning.html">
<link rel="import" href="ui/ct-test-output-tests.html">
<link rel="import" href="ui/ct-commit-tests.html">
<link rel="import" href="ui/ct-failure-grouper-tests.html">
<link rel="import" href="ui/ct-results-comparison-tests.html">
<link rel="import" href="ui/ct-test-output-tests.html">
</body>
<!--
Copyright (C) 2011 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
The favicons are from the awesome famfamfam.com, which is the website of Mark
James, a web developer from Birmingham, UK.
-->
<!DOCTYPE html>
<head>
<title>Sheriff-O-Matic</title>
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700">
<style>
html {
overflow-y: scroll;
}
body {
font-family: 'Open Sans';
font-size: 14px;
margin: 0px;
}
</style>
<script src="bower_components/platform/platform.js"></script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="ui/ct-sheriff-o-matic.html">
<ct-sheriff-o-matic></ct-sheriff-o-matic>
</head>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<polymer-element name="ct-commit-data" attributes="first last data">
<script>
Polymer({
data: [],
first: 0,
last: 0,
firstChanged: function() {
this.update_();
},
lastChanged: function() {
this.update_();
},
update_: function() {
this.data = model.commitDataListForRevisionRange(this.first, this.last);
},
});
</script>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-commit.html">
<link rel="import" href="ct-commit-data.html">
<polymer-element name="ct-commit-list" attributes="first last" noscript>
<template>
<style>
:host {
display: block;
}
</style>
<ct-commit-data first="{{first}}" last="{{last}}" data="{{commitData}}"></ct-commit-data>
<template repeat="{{commit in commitData}}">
<ct-commit data="{{commit}}"></ct-commit>
</template>
</template>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-commit.html">
<script>
(function () {
var kExampleCommitData = {
"revision": 2,
"title": "Fix one more layering violation caught by check-blink-deps",
"time": "2013-09-30T19:36:21Z",
"summary": "core/platform may not depend on core/ even for testing.",
"author": "eseidel@chromium.org",
"reviewer": "abarth@chromium.org, abarth",
"bugID": [12],
"revertedRevision": undefined
}
module("ct-commit");
asyncTest("basic", 3, function() {
var grouper = document.createElement('ct-commit');
grouper.data = kExampleCommitData;
Platform.endOfMicrotask(function() {
var html = grouper.shadowRoot.innerHTML;
equal(html.indexOf('eseidel') != -1, true)
equal(html.indexOf('abarth') != -1, true)
equal(html.indexOf('may not depend on') != -1, true)
start();
});
});
})()
</script>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<polymer-element name="ct-commit" attributes="data" noscript>
<template>
<style>
:host {
display: block;
}
</style>
{{data.revision}}: {{data.summary}} <em>{{data.author}} ({{data.reviewer}})</em>
</template>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<polymer-element name="ct-failure-analyzer" attributes="failures status">
<script>
Polymer({
failures: [],
pendingFailures: [],
update: function() {
this.pendingFailures = [];
var numberOfTestsAnalyzed = 0;
this.status = 'Updating ...';
Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder()]).then(function() {
this.status = 'Analyzing test failures ...';
model.analyzeUnexpectedFailures(function(failureAnalysis, total) {
this.status = 'Analyzing test failures ... ' + ++numberOfTestsAnalyzed + '/' + total + ' tests analyzed.';
this.pendingFailures.push(failureAnalysis);
}.bind(this)).then(function() {
this.status = 'Done!!!';
this.failures = this.pendingFailures;
}.bind(this));
}.bind(this));
},
});
</script>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-failure-grouper.html">
<script>
(function () {
module("ct-failure-grouper");
var kExampleFailures = [{
"testName": "http/tests/xmlhttprequest/access-control-basic-allow-preflight-cache-invalidation-by-method.html",
"resultNodesByBuilder": {
"WebKit XP": {
"expected": "PASS",
"is_unexpected": true,
"actual": "TEXT",
"time": 0.7
}
},
"oldestFailingRevision": 177165,
"newestPassingRevision": 177165
}, {
"testName": "http/tests/websocket/workers/close-code-and-reason.html",
"resultNodesByBuilder": {
"WebKit Mac10.7": {
"expected": "PASS",
"is_unexpected": true,
"actual": "TIMEOUT",
"time": 6
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177164
}, {
"testName": "plugins/gesture-events-scrolled.html",
"resultNodesByBuilder": {
"WebKit Win7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"time": 0.9
},
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 1.8
},
"WebKit Mac10.7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 3.2
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}, {
"testName": "plugins/transformed-events.html",
"resultNodesByBuilder": {
"WebKit Win7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"time": 0.6
},
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 1.4
},
"WebKit Mac10.7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 3
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}, {
"testName": "plugins/gesture-events.html",
"resultNodesByBuilder": {
"WebKit Win7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"time": 1.7
},
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 2.5
},
"WebKit Mac10.7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 3.4
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}, {
"testName": "inspector/console/console-viewport-selection.html",
"resultNodesByBuilder": {
"WebKit Linux (dbg)": {
"expected": "SLOW",
"is_unexpected": true,
"actual": "TEXT",
"bugs": ["webkit.org/b/90488"],
"time": 5.9
},
"WebKit Mac10.6 (dbg)": {
"actual": "TEXT",
"time": 6.5,
"bugs": ["webkit.org/b/90488"],
"is_unexpected": true,
"expected": "SLOW",
"has_stderr": true
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}, {
"testName": "svg/custom/foreign-object-skew.svg",
"resultNodesByBuilder": {
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "IMAGE",
"time": 0.9
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177164
}];
asyncTest("basic", 11, function() {
var grouper = document.createElement('ct-failure-grouper');
grouper.failures = kExampleFailures;
Platform.endOfMicrotask(function() {
var groups = grouper.groups;
equal(groups.length, 3);
equal(groups[0].length, 2);
equal(groups[0][0].testName, 'svg/custom/foreign-object-skew.svg');
equal(groups[0][1].testName, 'http/tests/websocket/workers/close-code-and-reason.html');
equal(groups[1].length, 4);
equal(groups[1][0].testName, 'plugins/transformed-events.html');
equal(groups[1][1].testName, 'plugins/gesture-events.html');
equal(groups[1][2].testName, 'plugins/gesture-events-scrolled.html');
equal(groups[1][3].testName, 'inspector/console/console-viewport-selection.html');
equal(groups[2].length, 1);
equal(groups[2][0].testName, 'http/tests/xmlhttprequest/access-control-basic-allow-preflight-cache-invalidation-by-method.html');
start();
});
});
})()
</script>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<polymer-element name="ct-failure-grouper" attributes="failures groups">
<script>
Polymer({
failures: [],
groups: [],
failureComparator: function(a, b) {
return a.testName < b.testName;
},
failuresChanged: function() {
var map = {};
for (var i = 0; i < this.failures.length; ++i) {
var failureAnalysis = this.failures[i];
var key = failureAnalysis.newestPassingRevision + "+" + failureAnalysis.oldestFailingRevision;
if (!(key in map))
map[key] = [];
map[key].push(failureAnalysis);
}
this.groups = [];
var keys = Object.getOwnPropertyNames(map).sort();
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
this.groups[i] = map[key].sort(this.failureComparator.bind(this));
}
},
});
</script>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-commit-list.html">
<polymer-element name="ct-failure-stream" attributes="groups" noscript>
<template>
<template repeat="{{failures in groups}}">
<hr>
<template repeat="{{failure in failures}}">{{failure.testName}}<br></template>
<ct-commit-list first="{{failures[0].newestPassingRevision + 1}}" last="{{failures[0].oldestFailingRevision}}"></ct-commits>
</template>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="../scripts/base.js"></script>
<script src="../scripts/config.js"></script>
<script src="../scripts/net.js"></script>
<script src="../scripts/rollbot.js"></script>
<script src="../scripts/svn-log.js"></script>
<script src="../scripts/treestatus.js"></script>
<script src="../scripts/builders.js"></script>
<script src="../scripts/results.js"></script>
<script src="../scripts/ui.js"></script>
<script src="../scripts/model.js"></script>
<link rel="import" href="../bower_components/core-pages/core-pages.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tab.html">
<link rel="import" href="ct-unexpected-failures.html">
<polymer-element name="ct-sheriff-o-matic">
<template>
<style>
paper-tabs {
background-color: #00bcd4;
color: #fff;
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2);
}
</style>
<paper-tabs selected="{{selected}}">
<paper-tab>Unexpected Failures</paper-tab>
<paper-tab>Results</paper-tab>
</paper-tabs>
<core-pages selected="{{selected}}">
<ct-unexpected-failures></ct-unexpected-failures>
</core-pages>
</template>
<script>
Polymer({
selected: 0,
});
</script>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<link rel="import" href="ct-failure-analyzer.html">
<link rel="import" href="ct-failure-grouper.html">
<link rel="import" href="ct-failure-stream.html">
<polymer-element name="ct-unexpected-failures">
<template>
<style>
paper-toast {
bottom: 40px;
left: 10px;
}
#update {
background: #4285f4;
color: #fff;
}
</style>
<ct-failure-analyzer id="analyzer" status="{{analyzerStatus}}" failures="{{failures}}"></ct-failure-analyzer>
<ct-failure-grouper failures="{{failures}}" groups="{{failureGroups}}"></ct-failure-grouper>
<paper-button id="update" on-tap="{{update}}">Update</paper-button>
<ct-failure-stream groups="{{failureGroups}}"></ct-failure-stream>
<paper-toast id="toast" text="{{analyzerStatus}}"></paper-toast>
</template>
<script>
Polymer({
attached: function() {
this.update();
},
update: function() {
this.$.analyzer.update();
},
analyzerStatusChanged: function() {
this.$.toast.show();
},
});
</script>
</polymer-element>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment