| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../js/resources/js-test-pre.js"></script> | 2 <script src="../../js/resources/js-test-pre.js"></script> |
| 3 <script src="testutils.js"></script> | 3 <script src="testutils.js"></script> |
| 4 <body> | 4 <body> |
| 5 <x-a></x-a> | 5 <x-a></x-a> |
| 6 <x-a></x-a> | |
| 7 <x-a></x-a> | |
| 8 <script> | 6 <script> |
| 9 if (fork()) { | 7 if (fork()) { |
| 10 // The controlling parent frame | 8 // The controlling parent frame |
| 11 description('Tests destroying a context during element upgrade.'); | 9 description('Tests destroying a context during attributeChanged callback.'); |
| 12 jsTestIsAsync = true; | 10 jsTestIsAsync = true; |
| 13 successfullyParsed = true; | 11 successfullyParsed = true; |
| 14 } else { | 12 } else { |
| 15 // The child frame | 13 // The child frame |
| 16 | 14 |
| 17 var n = 0; | |
| 18 var proto = Object.create(HTMLElement.prototype); | 15 var proto = Object.create(HTMLElement.prototype); |
| 19 proto.createdCallback = function () { | 16 proto.attributeChangedCallback = function () { |
| 20 if (++n == 2) | 17 destroyContext(); |
| 21 destroyContext(); | |
| 22 }; | 18 }; |
| 23 | 19 |
| 24 var A = document.register('x-a', {prototype: proto}); | 20 var A = document.register('x-a', {prototype: proto}); |
| 25 new A(); | 21 var a = new A(); |
| 22 a.id = 'boom'; |
| 26 done(); | 23 done(); |
| 27 } | 24 } |
| 28 </script> | 25 </script> |
| 29 <script src="../../js/resources/js-test-post.js"></script> | 26 <script src="../../js/resources/js-test-post.js"></script> |
| OLD | NEW |