| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 if (window.testRunner) | 6 if (window.testRunner) |
| 7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
| 8 | 8 |
| 9 function runTest() | 9 function runTest() |
| 10 { | 10 { |
| 11 var host = document.getElementById('host'); | 11 var host = document.getElementById('host'); |
| 12 var sr = host.createShadowRoot(); | 12 var sr = host.createShadowRoot(); |
| 13 sr.innerHTML = '<style>background-color: red;</style><div>Shadow</div>'; | 13 sr.innerHTML = '<style>background-color: red;</style><div>Shadow</div>'; |
| 14 | 14 |
| 15 // Need to use ShadowRoot.styleSheets API to create a styleSheetList. | 15 // Need to use ShadowRoot.styleSheets API to create a styleSheetList. |
| 16 sr.styleSheets.length; | 16 sr.styleSheets.length; |
| 17 host.parentNode.removeChild(host); | 17 host.parentNode.removeChild(host); |
| 18 | 18 |
| 19 setTimeout(function() { | 19 setTimeout(function() { |
| 20 gc(); | 20 gc(); |
| 21 gc(); // FIXME: remove one gc() after refactoring gc()'s c++ code. | |
| 22 | 21 |
| 23 if (window.testRunner) | 22 if (window.testRunner) |
| 24 testRunner.notifyDone(); | 23 testRunner.notifyDone(); |
| 25 }, 0); | 24 }, 0); |
| 26 } | 25 } |
| 27 </script> | 26 </script> |
| 28 </head> | 27 </head> |
| 29 <body onload="runTest()"> | 28 <body onload="runTest()"> |
| 30 <div id='host'></div> | 29 <div id='host'></div> |
| 31 <pre id='console'></pre> | 30 <pre id='console'></pre> |
| 32 </body> | 31 </body> |
| 33 <script> | 32 <script> |
| 34 description('Test for crbug.com/337059: accessing StyleSheetList::document() fro
m GC causes crash.'); | 33 description('Test for crbug.com/337059: accessing StyleSheetList::document() fro
m GC causes crash.'); |
| 35 </script> | 34 </script> |
| 36 </html> | 35 </html> |
| OLD | NEW |