1 <!-- 2 Copyright 2014 The Chromium Authors. All rights reserved. 3 Use of this source code is governed by a BSD-style license that can be 4 found in the LICENSE file. 5 --> 6 7 <polymer-element name="ct-embedded-flakiness-dashboard" attributes="test"> 8 <template> 9 <style> 10 :host { 11 display: block; 12 } 13 #iframe { 14 border: none; 15 width: 100%; 16 } 17 </style> 18 <iframe id="iframe"></iframe> 19 </template> 20 <script> 21 Polymer({ 22 test: "", 23 24 ready: function() { 25 window.addEventListener('message', function(event) { 26 if (event.data.command != 'heightChanged') 27 return; 28 29 this.$.iframe.style.height = event.data.height + 'px'; 30 }.bind(this)); 31 }, 32 33 testChanged: function() { 34 // Use location.replace so we don't create extraneous history events. 35 this.$.iframe.contentWindow.location.replace(this.test.embeddedFlakinessDashboardURL()); 36 }, 37 38 }); 39 </script> 40 </polymer-element> 41