OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <!-- Copyright (c) 2014 Google Inc. All rights reserved. --> |
| 3 <html> |
| 4 <head> |
| 5 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initia
l-scale=1.0, user-scalable=yes"> |
| 6 <title>google-youtube Basic Tests</title> |
| 7 <script src="../../platform/platform.js"></script> |
| 8 <link rel="import" href="../../polymer-test-tools/tools.html"> |
| 9 <script src="../../polymer-test-tools/htmltest.js"></script> |
| 10 <link rel="import" href="../google-youtube.html"> |
| 11 </head> |
| 12 <body> |
| 13 <google-youtube thumbnail="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAI
AAAACCAYAAABytg0kAAAAFElEQVQIHWP4z8DwHwyBNJDN8B8AQNEG+t5Ik2kAAAAASUVORK5CYII="><
/google-youtube> |
| 14 |
| 15 <script> |
| 16 function testThumbnailImgPresent(googleYouTube) { |
| 17 assert.ok(googleYouTube.shadowRoot.querySelector('img'), 'thumbnail <img
> is present.'); |
| 18 } |
| 19 |
| 20 function testTapHandlerLoadsEmbed(googleYouTube) { |
| 21 googleYouTube.addEventListener('google-youtube-ready', function(e) { |
| 22 assert.notOk(googleYouTube.shadowRoot.querySelector('img'), 'thumbnail
<img> is no longer present.'); |
| 23 |
| 24 assert.ok(googleYouTube.shadowRoot.querySelector('iframe'), 'YouTube e
mbed <iframe> is present.'); |
| 25 |
| 26 done(); |
| 27 }); |
| 28 |
| 29 // Trigger the on-tap handler. |
| 30 googleYouTube.handleThumbnailTap(); |
| 31 } |
| 32 |
| 33 document.addEventListener('polymer-ready', function() { |
| 34 var googleYouTube = document.querySelector('google-youtube'); |
| 35 |
| 36 testThumbnailImgPresent(googleYouTube); |
| 37 testTapHandlerLoadsEmbed(googleYouTube); |
| 38 }); |
| 39 </script> |
| 40 </body> |
| 41 </html> |
OLD | NEW |