Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / svg-image-load-outlives-gc-without-crashing.html
blobf5dc60220c0dfe77f2f6fc5bd978b2448fce27c9
1 <script src="/js-test-resources/js-test.js"></script>
2 <script>
4 if (window.testRunner) {
5 testRunner.waitUntilDone();
6 testRunner.dumpAsText();
9 function loaded() {
10 // If the garbage collection causes the image load to stop and therefore causes the load event to fire on the main frame, we failed.
11 alert("FAIL: The load event fired");
13 if (window.testRunner)
14 testRunner.notifyDone();
17 </script>
18 <body onload="loaded();">
20 This has an svg element that contains an svg image element. That svg element is wrapped in a div. It removes the div, forces garbage collection, and makes sure that the window load event does not fire. It also makes sure there is no crash.<br>
21 <div id="thediv">
22 <svg>
23 <image xlink:href="resources/slowimage.php" />
24 </svg>
25 </div>
26 </body>
27 <script>
29 function finished() {
30 window.stop()
31 if (window.testRunner)
32 testRunner.notifyDone();
35 function forceGC() {
36 gc();
37 setTimeout("finished();", 0);
40 function removeTheDiv() {
41 var element = window.document.getElementById("thediv");
42 element.parentNode.removeChild(element);
43 element = null;
44 setTimeout("forceGC();", 0);
47 setTimeout("removeTheDiv();", 0);
49 </script>