OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <script src="testutils.js"></script> | 3 <script src="testutils.js"></script> |
4 <body> | 4 <body> |
5 <script> | 5 <script> |
6 if (fork()) { | 6 if (fork()) { |
7 // The controlling parent frame | 7 // The controlling parent frame |
8 description('Tests destroying a context during registration at the point whe
n the prototype is retrieved.'); | 8 description('Tests destroying a context during registration at the point whe
n the prototype is retrieved.'); |
9 jsTestIsAsync = true; | 9 jsTestIsAsync = true; |
10 successfullyParsed = true; | 10 successfullyParsed = true; |
11 } else { | 11 } else { |
12 // The child frame | 12 // The child frame |
13 | 13 |
14 var proto = Object.create(HTMLElement.prototype); | 14 var proto = Object.create(HTMLElement.prototype); |
15 var options = Object.create(Object.prototype, { | 15 var options = Object.create(Object.prototype, { |
16 prototype: { | 16 prototype: { |
17 get: function () { | 17 get: function () { |
18 destroyContext(); | 18 destroyContext(); |
19 return proto; | 19 return proto; |
20 } | 20 } |
21 } | 21 } |
22 }); | 22 }); |
23 | 23 |
24 try { | 24 try { |
25 document.register('x-a', options); | 25 document.registerElement('x-a', options); |
26 log('FAIL expected register to throw an exception'); | 26 log('FAIL expected register to throw an exception'); |
27 } catch (ex) { | 27 } catch (ex) { |
28 log('PASS caught expected exception "' + ex + '"'); | 28 log('PASS caught expected exception "' + ex + '"'); |
29 } | 29 } |
30 done(); | 30 done(); |
31 } | 31 } |
32 </script> | 32 </script> |
OLD | NEW |