Browse Source

test: re-enable window.open referrer test (#36155)

Co-authored-by: John Kleinschmidt <[email protected]>
Shelley Vohr 2 years ago
parent
commit
8b430c9d26
1 changed files with 2 additions and 4 deletions
  1. 2 4
      spec/api-web-contents-spec.ts

+ 2 - 4
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")');