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

Unified Diff: Tools/GardeningServer/ui/ct-results-comparison.html

Issue 350563002: Port first garden-o-matic component over to polymer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use mdv Created 6 years, 6 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: Tools/GardeningServer/ui/ct-results-comparison.html
diff --git a/Tools/GardeningServer/ui/ct-results-comparison.html b/Tools/GardeningServer/ui/ct-results-comparison.html
new file mode 100644
index 0000000000000000000000000000000000000000..91d7adcd0297bcbfb5e833b58c03b324b39b8865
--- /dev/null
+++ b/Tools/GardeningServer/ui/ct-results-comparison.html
@@ -0,0 +1,65 @@
+<!--
+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-results-comparison" attributes="type expectedUrl actualUrl diffUrl">
+ <template>
+ <style>
+ :host {
+ display: flex;
+ flex-wrap: wrap;
+ width: 100%;
+ }
+ .container {
+ flex: 1;
+ min-width: 300px;
+ }
+ .result {
+ border: 1px solid gray;
+ }
+ iframe {
+ border: none;
+ width: 100%;
+ height: 400px;
+ }
+ img {
+ width: 100%;
+ }
+ </style>
+
+ <template repeat="{{resultKind in _resultKinds}}">
+ <div class="container">
+ <h2>{{resultKind}}</h2>
+ <div class="result">
+ <template if="{{type == _kImageType && _urlForKind(resultKind)}}">
+ <img src="{{_urlForKind(resultKind)}}">
+ </template>
+ <template if="{{type == _kTextType && _urlForKind(resultKind)}}">
+ <iframe src="{{_urlForKind(resultKind)}}"></iframe>
+ </template>
+ <template if="{{type == _kAudioType && _urlForKind(resultKind)}}">
+ <audio controls src="{{_urlForKind(resultKind)}}"></audio>
+ </template>
+ </div>
+ </div>
+ </template>
+ </template>
+ <script>
+ Polymer({
+ _urlForKind: function(kind) {
+ if (kind == "Expected")
+ return this.expectedUrl;
+ if (kind == "Actual")
+ return this.actualUrl;
+ if (kind == "Diff")
+ return this.diffUrl;
+ },
+ _kAudioType: results.kAudioType,
+ _kImageType: results.kImageType,
+ _kTextType: results.kTextType,
+ _resultKinds: ["Expected", "Actual", "Diff"],
+ });
+ </script>
+</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698