| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title></title> |
| 14 <meta charset="UTF-8"> |
| 15 <script> |
| 16 window.addEventListener('HTMLImportsLoaded', function() { |
| 17 window.importsOk = true; |
| 18 }); |
| 19 window.webComponentsReadyCount = 0; |
| 20 document.addEventListener('WebComponentsReady', function() { |
| 21 window.webComponentsReadyCount++; |
| 22 }); |
| 23 </script> |
| 24 <script src="../webcomponents-loader.js"></script> |
| 25 <script src="../../web-component-tester/browser.js"></script> |
| 26 <link rel="import" href="imports/import-file.html"> |
| 27 </head> |
| 28 <body> |
| 29 <my-element></my-element> |
| 30 <script> |
| 31 window.addEventListener('WebComponentsReady', () => { |
| 32 class MyElement extends HTMLElement { |
| 33 connectedCallback(){ |
| 34 this.textContent = 'upgraded!'; |
| 35 } |
| 36 } |
| 37 customElements.define('my-element', MyElement); |
| 38 }); |
| 39 suite('Loader', function() { |
| 40 test('expected boot', function() { |
| 41 assert.equal(window.webComponentsReadyCount, 1, 'failed to fire WebCom
ponentsReady'); |
| 42 if (window.HTMLImports) { |
| 43 assert.ok(window.importsOk, 'WebComponentsReady without HTMLImportsL
oaded'); |
| 44 } |
| 45 assert.ok(window.importTest, 'import failed to set global value'); |
| 46 }); |
| 47 test('WebComponentsReady was fired on document and bubbled', function()
{ |
| 48 assert.equal(document.querySelector('my-element').textContent, 'upgrad
ed!'); |
| 49 }) |
| 50 }); |
| 51 </script> |
| 52 </body> |
| 53 </html> |
| OLD | NEW |