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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed.html

Issue 2066533003: Use asyncGC instead of GC in fast/events/message-port-gc-closed*.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script> 4 <script>
5 description("MessagePorts (and their execution contexts) should be collected by GC once close() has been called on them"); 5 description("MessagePorts (and their execution contexts) should be collected by GC once close() has been called on them");
6 6
7 window.jsTestIsAsync = true; 7 window.jsTestIsAsync = true;
8 8
9 function runGCAndTest() { 9 function runGCAndTest() {
10 gc(); 10 asyncGC(function() {
11 shouldBeTrue("iframeDocGC.wasCollected"); 11 shouldBeTrue("iframeDocGC.wasCollected");
12 finishJSTest(); 12 finishJSTest();
13 });
13 } 14 }
14 15
15 window.onmessage = function(evt) { 16 window.onmessage = function(evt) {
16 iframeDocGC = internals.observeGC(document.querySelector('iframe').contentDo cument); 17 iframeDocGC = internals.observeGC(document.querySelector('iframe').contentDo cument);
17 document.querySelector('iframe').remove(); 18 document.querySelector('iframe').remove();
18 // The iframe is reachable via evt.source, and evt is on the 19 // The iframe is reachable via evt.source, and evt is on the
19 // stack. Force a GC upon return from the event handler, so 20 // stack. Force a GC upon return from the event handler, so
20 // that it no longer will be in scope and the iframe can 21 // that it no longer will be in scope and the iframe can
21 // be GCed. 22 // be GCed.
22 setTimeout(runGCAndTest, 0); 23 setTimeout(runGCAndTest, 0);
23 } 24 }
24 </script> 25 </script>
25 <iframe src="resources/message-port-gc-closed-iframe.html"></iframe> 26 <iframe src="resources/message-port-gc-closed-iframe.html"></iframe>
26 </body> 27 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698