OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 5 <meta name="dart.unittest" content="full-stack-traces"> |
| 6 <title> interop_test.html </title> |
| 7 <style> |
| 8 .unittest-table { font-family:monospace; border:1px; } |
| 9 .unittest-pass { background: #6b3;} |
| 10 .unittest-fail { background: #d55;} |
| 11 .unittest-error { background: #a11;} |
| 12 </style> |
| 13 <script src="/packages/web_components/platform.js"></script> |
| 14 <script src="/packages/web_components/dart_support.js"></script> |
| 15 </head> |
| 16 <body> |
| 17 <h1> Running interop_test </h1> |
| 18 <script> |
| 19 var counter = 0; |
| 20 var A = function() {}; |
| 21 A.prototype = Object.create(HTMLElement.prototype); |
| 22 A.prototype.inc = function() { this.x = counter++; }; |
| 23 A.prototype.createdCallback = function() { this.inc(); }; |
| 24 |
| 25 var B = function() {}; |
| 26 B.prototype = Object.create(HTMLDivElement.prototype); |
| 27 B.prototype.createdCallback = function() { this.x = counter++; }; |
| 28 B.extends = 'div'; |
| 29 |
| 30 document.registerElement('x-a', A); |
| 31 document.registerElement('x-b', B); |
| 32 |
| 33 function registerC() { |
| 34 var proto = Object.create(HTMLElement.prototype, { |
| 35 inc: { value: function() { this.x = counter++; } }, |
| 36 createdCallback: { |
| 37 value: function() { this.inc(); }, |
| 38 configurable: true}, |
| 39 }); |
| 40 document.registerElement('x-c', {prototype: proto}); |
| 41 } |
| 42 function addA() { |
| 43 document.body.appendChild(document.createElement('x-a')); |
| 44 } |
| 45 function addB() { |
| 46 document.body.appendChild(document.createElement('div', 'x-b')); |
| 47 } |
| 48 function addC() { |
| 49 document.body.appendChild(document.createElement('x-c')); |
| 50 } |
| 51 </script> |
| 52 <x-a id="i1"></x-a> |
| 53 <div is="x-b" id="i2"></div> |
| 54 <x-c id="i3"></x-b> |
| 55 <script type="text/javascript" |
| 56 src="/root_dart/tools/testing/dart/test_controller.js"></script> |
| 57 %TEST_SCRIPTS% |
| 58 </body> |
| 59 </html> |
OLD | NEW |