OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 var t = async_test("Garbage collection of ImageResourceContent while " + |
| 6 "asynchronous loading of SVG is in progress " + |
| 7 "shouldn't crash. crbug.com/726220"); |
| 8 var img; |
| 9 |
| 10 function step1() { |
| 11 setTimeout(t.step_func(step2), 0); |
| 12 |
| 13 // 1. Creating an <img> element with SVG of which loading is not completed |
| 14 // synchronously. |
| 15 img = document.createElement('img'); |
| 16 img.src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><foreignOb
ject><body xmlns="http://www.w3.org/1999/xhtml"><marquee></marquee></body></fore
ignObject></svg>'; |
| 17 document.body.appendChild(img); |
| 18 assert_false(img.complete); |
| 19 } |
| 20 |
| 21 function step2() { |
| 22 // 2. Adopt the <img> to a new document. |
| 23 newdoc = document.implementation.createDocument("svg", null); |
| 24 newdoc.adoptNode(img); |
| 25 |
| 26 // 3. Do garbage collection. The oold ImageResourceContent is garbage |
| 27 // collected while async SVG loading is still in progress. |
| 28 gc(); |
| 29 |
| 30 setTimeout(t.step_func_done(), 100); |
| 31 } |
| 32 |
| 33 </script> |
| 34 <body onload="setTimeout(t.step_func(step1), 0)"></body> |
OLD | NEW |