| <!DOCTYPE html> |
| <script src="../../../resources/js-test.js"></script> |
| <script src="testutils.js"></script> |
| <body> |
| <script> |
| if (fork()) { |
| // The controlling parent frame |
| description('Tests destroying a context during registration at the point when the created callback is retrieved.'); |
| jsTestIsAsync = true; |
| successfullyParsed = true; |
| } else { |
| // The child frame |
| |
| var proto = Object.create(HTMLElement.prototype, { |
| createdCallback: { |
| get: function () { |
| destroyContext(); |
| return function () { } |
| } |
| } |
| }); |
| |
| try { |
| document.registerElement('x-a', {prototype: proto}); |
| log('FAIL expected register to throw an exception'); |
| } catch (ex) { |
| log('PASS caught expected exception "' + ex + '"'); |
| } |
| done(); |
| } |
| </script> |