| 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://polym
er.github.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/CO
NTRIBUTORS.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/P
ATENTS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title></title> |
| 14 <meta charset="UTF-8"> |
| 15 <script src="../webcomponents-loader.js"></script> |
| 16 <script src="../../web-component-tester/browser.js"></script> |
| 17 </head> |
| 18 <body> |
| 19 <x-foo>plain</x-foo> |
| 20 |
| 21 <script> |
| 22 test('smoke', function(done) { |
| 23 class XFoo extends HTMLElement { |
| 24 connectedCallback() { |
| 25 this.textContent = 'x-foo!'; |
| 26 } |
| 27 } |
| 28 window.customElements.define('x-foo', XFoo); |
| 29 assert.equal(document.querySelector('x-foo').textContent, 'x-foo!', |
| 30 'x-foo must have custom text'); |
| 31 |
| 32 class XZot extends HTMLElement { |
| 33 connectedCallback() { |
| 34 this.textContent = 'x-zot!'; |
| 35 } |
| 36 } |
| 37 window.customElements.define('x-zot', XZot); |
| 38 |
| 39 var xfoo = document.querySelector('x-foo'); |
| 40 var root = xfoo.attachShadow({mode: 'open'}); |
| 41 var xzot = document.createElement('x-zot'); |
| 42 |
| 43 var handler = function() { |
| 44 assert.equal(xzot.textContent, 'custom!', 'x-zot in shadow root must h
ave custom text'); |
| 45 done(); |
| 46 } |
| 47 var ob = new MutationObserver(handler); |
| 48 ob.observe(root, {childList: true, subtree: true}); |
| 49 root.appendChild(xzot); |
| 50 }); |
| 51 </script> |
| 52 </body> |
| 53 </html> |
| OLD | NEW |