| 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 WCT = { |
| 17 waitFor: function(cb) { |
| 18 cb(); |
| 19 } |
| 20 } |
| 21 </script> |
| 22 <script src="../webcomponents-loader.js"></script> |
| 23 <script src="../../web-component-tester/browser.js"></script> |
| 24 <link rel="import" href="imports/element-import-a.html"> |
| 25 </head> |
| 26 <body> |
| 27 <x-test></x-test> |
| 28 |
| 29 <script> |
| 30 var created = 0; |
| 31 function register() { |
| 32 class XTest extends HTMLElement { |
| 33 connectedCallback() { |
| 34 created++; |
| 35 } |
| 36 } |
| 37 window.customElements.define('x-test', XTest); |
| 38 } |
| 39 |
| 40 test('upgraded document tree', function(done) { |
| 41 if (CustomElements.useNative || !window.HTMLImports) { |
| 42 return done(); |
| 43 } else { |
| 44 window.addEventListener('WebComponentsReady', function() { |
| 45 CustomElements.ready = false; |
| 46 register(); |
| 47 assert.equal(created, 0, 'no elements created when ready explicitly
set to false'); |
| 48 CustomElements.upgradeDocumentTree(document); |
| 49 assert.equal(created, 3, 'elements in document tree upgraded via Cus
tomElements.upgradeDocumentTree'); |
| 50 done(); |
| 51 }); |
| 52 } |
| 53 }); |
| 54 </script> |
| 55 </body> |
| 56 </html> |
| OLD | NEW |