From 8b430c9d26709193588175a0bb9196aa3547a8ae Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 1 Nov 2022 11:11:11 -0400 Subject: [PATCH] test: re-enable window.open referrer test (#36155) Co-authored-by: John Kleinschmidt --- spec/api-web-contents-spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index b8d43ae935..f92ff5abe7 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -1665,9 +1665,7 @@ describe('webContents module', () => { }); }); - // TODO(jeremy): window.open() in a real browser passes the referrer, but - // our hacked-up window.open() shim doesn't. It should. - xit('propagates referrer information to windows opened with window.open', (done) => { + it('propagates referrer information to windows opened with window.open', (done) => { const w = new BrowserWindow({ show: false }); const server = http.createServer((req, res) => { if (req.url === '/should_have_referrer') { @@ -1685,7 +1683,7 @@ describe('webContents module', () => { w.webContents.once('did-finish-load', () => { w.webContents.setWindowOpenHandler(details => { expect(details.referrer.url).to.equal(url); - expect(details.referrer.policy).to.equal('no-referrer-when-downgrade'); + expect(details.referrer.policy).to.equal('strict-origin-when-cross-origin'); return { action: 'allow' }; }); w.webContents.executeJavaScript('window.open(location.href + "should_have_referrer")');