OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <iframe id="iframe-for-document.location"></iframe> |
| 5 <iframe id="iframe-for-window.location"></iframe> |
| 6 <script> |
| 7 test(() => { |
| 8 let observation; |
| 9 (function() { |
| 10 let iframe = document.getElementById("iframe-for-document.location"); |
| 11 let location = iframe.contentDocument.location; |
| 12 observation = internals.observeGC(location); |
| 13 })(); |
| 14 gc(); |
| 15 assert_false(observation.wasCollected, "Location wrapper object was collected.
"); |
| 16 }, "document.location shouldn't be collected by GC."); |
| 17 |
| 18 test(() => { |
| 19 let observation; |
| 20 (function() { |
| 21 let iframe = document.getElementById("iframe-for-window.location"); |
| 22 let location = iframe.contentWindow.location; |
| 23 observation = internals.observeGC(location); |
| 24 })(); |
| 25 gc(); |
| 26 assert_false(observation.wasCollected, "Location wrapper object was collected.
"); |
| 27 }, "window.location shouldn't be collected by GC."); |
| 28 </script> |
OLD | NEW |