blob: 2fa7c79b8e0c4a24129ff55c91dcb87748406e30 [file] [log] [blame]
<!doctype html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<iframe id="iframe-for-document.location"></iframe>
<iframe id="iframe-for-window.location"></iframe>
<script>
test(() => {
let observation;
(function() {
let iframe = document.getElementById("iframe-for-document.location");
let location = iframe.contentDocument.location;
observation = internals.observeGC(location);
})();
gc();
assert_false(observation.wasCollected, "Location wrapper object was collected.");
}, "document.location shouldn't be collected by GC.");
test(() => {
let observation;
(function() {
let iframe = document.getElementById("iframe-for-window.location");
let location = iframe.contentWindow.location;
observation = internals.observeGC(location);
})();
gc();
assert_false(observation.wasCollected, "Location wrapper object was collected.");
}, "window.location shouldn't be collected by GC.");
</script>