3 add_task(async function () {
4 let webnav = Services.appShell.createWindowlessBrowser(false);
6 let docShell = webnav.docShell;
8 docShell.createAboutBlankDocumentViewer(null, null);
10 let window = webnav.document.defaultView;
12 let iframe = window.eval(`
13 iframe = document.createElement("iframe");
15 document.body.appendChild(iframe)
19 let unwrapped = Cu.waiveXrays(iframe);
29 class A extends Base {
41 Assert.equal(A.gx(iframe), 12);
42 A.sx(iframe, 'wrapped');
44 // Shouldn't tunnel past xray.
45 Assert.throws(() => A.gx(unwrapped), TypeError);
46 Assert.throws(() => A.sx(unwrapped, 'unwrapped'), TypeError);
49 Assert.equal(A.gx(unwrapped), 12);
50 Assert.equal(A.gx(iframe), 'wrapped');
52 A.sx(iframe, 'modified');
53 Assert.equal(A.gx(unwrapped), 12);
55 Assert.equal(A.gx(iframe), 'modified');