Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: LayoutTests/http/tests/misc/object-image-load-outlives-gc-without-crashing.html

Issue 66113002: Partial revert of r161493. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge to ToT Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <script src="/js-test-resources/js-test.js"></script> 1 <script src="/js-test-resources/js-test.js"></script>
2 <script> 2 <script>
3 3
4 if (window.testRunner) { 4 if (window.testRunner) {
5 » window.jsTestIsAsync = true; 5 » testRunner.waitUntilDone();
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 } 7 }
8 8
9 function loaded() { 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. 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"); 11 alert("FAIL: The load event fired");
12 » finishJSTest(); 12 »
13 » if (window.testRunner)
14 » » testRunner.notifyDone();
13 } 15 }
14 16
15 </script> 17 </script>
16 <body onload="loaded();"> 18 <body onload="loaded();">
17 19
18 This has an object element representing an image. That object element is wrappe d 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> 20 This has an object element representing an image. That object element is wrappe d 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>
19 <div id="thediv"> 21 <div id="thediv">
20 <object type="image/gif" data="resources/slowimage.php"> 22 <object type="image/gif" data="resources/slowimage.php">
21 </object> 23 </object>
22 </div> 24 </div>
23 </body> 25 </body>
24 <script> 26 <script>
25 27
26 function finished() { 28 function finished() {
27 window.stop() 29 window.stop()
28 » finishJSTest(); 30 » if (window.testRunner)
31 » » testRunner.notifyDone();
29 } 32 }
30 33
31 function forceGC() { 34 function forceGC() {
32 gc(); 35 gc();
33 setTimeout("finished();", 0); 36 setTimeout("finished();", 0);
34 } 37 }
35 38
36 function removeTheDiv() { 39 function removeTheDiv() {
37 var element = window.document.getElementById("thediv"); 40 var element = window.document.getElementById("thediv");
38 element.parentNode.removeChild(element); 41 element.parentNode.removeChild(element);
39 element = null; 42 element = null;
40 setTimeout("forceGC();", 0); 43 setTimeout("forceGC();", 0);
41 } 44 }
42 45
43 setTimeout("removeTheDiv();", 0); 46 setTimeout("removeTheDiv();", 0);
44 47
45 </script> 48 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698