1
0
Fork 0
firefox/testing/web-platform/tests/html/browsers/windows/opener-string.window.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

14 lines
674 B
JavaScript

test(t => {
const popup = window.open();
t.add_cleanup(() => popup.close());
assert_equals(popup.opener, self, "The opener of the popup is me");
assert_equals(Object.getOwnPropertyDescriptor(popup, "opener").writable, undefined);
popup.opener = "blah";
assert_equals(popup.opener, "blah", "The popup's opener is now a string");
assert_equals(Object.getOwnPropertyDescriptor(popup, "opener").writable, true);
const openerGetter = Object.getOwnPropertyDescriptor(self, "opener").get;
const popupOpener = openerGetter.call(popup);
assert_equals(popupOpener, self, "The underlying opener of the popup is still me");
}, "Setting popup.opener to a string");