Chromium Code Reviews| 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 created callback is retrieved.'); | 8 description('Tests throwing an exception during registeration of' |
|
vivekg
2015/04/21 09:42:49
nit: registeration => registration. Also this coul
| |
| 9 + 'constructor'); | |
| 9 jsTestIsAsync = true; | 10 jsTestIsAsync = true; |
| 10 successfullyParsed = true; | 11 successfullyParsed = true; |
| 11 } else { | 12 } else { |
| 12 // The child frame | |
| 13 | |
| 14 var proto = Object.create(HTMLElement.prototype, { | 13 var proto = Object.create(HTMLElement.prototype, { |
| 15 createdCallback: { | 14 constructor: { |
| 16 get: function () { | 15 configurable: true, |
| 17 destroyContext(); | 16 get: function () { throw "Exception thrown from getter"; } |
| 18 return function () { } | |
| 19 } | 17 } |
| 20 } | 18 }); |
| 21 }); | |
| 22 | 19 |
| 23 try { | 20 try { |
| 24 document.registerElement('x-a', {prototype: proto}); | 21 var element = document.registerElement('x-a', {prototype: proto}); |
|
vivekg
2015/04/21 09:42:49
Can we use shouldThrow('document.registerElement(.
| |
| 25 log('FAIL expected register to throw an exception'); | 22 log('FAIL expected register to throw an exception'); |
| 26 } catch (ex) { | 23 } catch (ex) { |
| 27 log('PASS caught expected exception "' + ex + '"'); | 24 log('PASS caught expected exception "' + ex + '"'); |
| 28 } | 25 } |
| 29 done(); | 26 done(); |
| 30 } | 27 } |
| 31 </script> | 28 </script> |
| OLD | NEW |