Browse Source

test: re-enable some skipped tests (#29655)

* test: re-enable some skipped tests

* test: enable more tests
David Sanders 3 years ago
parent
commit
214fcfc46d

+ 1 - 2
spec-main/api-browser-window-spec.ts

@@ -406,8 +406,7 @@ describe('BrowserWindow module', () => {
       await expect(p).to.eventually.be.fulfilled;
     });
 
-    // FIXME(robo/nornagon): re-enable these once service workers work
-    describe.skip('POST navigations', () => {
+    describe('POST navigations', () => {
       afterEach(() => { w.webContents.session.webRequest.onBeforeSendHeaders(null); });
 
       it('supports specifying POST data', async () => {

+ 7 - 5
spec-main/api-protocol-spec.ts

@@ -754,7 +754,7 @@ describe('protocol module', () => {
     });
   });
 
-  describe.skip('protocol.registerSchemesAsPrivileged standard', () => {
+  describe('protocol.registerSchemesAsPrivileged standard', () => {
     const standardScheme = (global as any).standardScheme;
     const origin = `${standardScheme}://fake-host`;
     const imageURL = `${origin}/test.png`;
@@ -766,7 +766,8 @@ describe('protocol module', () => {
       w = new BrowserWindow({
         show: false,
         webPreferences: {
-          nodeIntegration: true
+          nodeIntegration: true,
+          contextIsolation: false
         }
       });
     });
@@ -834,7 +835,7 @@ describe('protocol module', () => {
     });
   });
 
-  describe.skip('protocol.registerSchemesAsPrivileged cors-fetch', function () {
+  describe('protocol.registerSchemesAsPrivileged cors-fetch', function () {
     const standardScheme = (global as any).standardScheme;
     let w: BrowserWindow = null as unknown as BrowserWindow;
     beforeEach(async () => {
@@ -867,7 +868,8 @@ describe('protocol module', () => {
       });
     });
 
-    it('disallows CORS and fetch requests when only supportFetchAPI is specified', async () => {
+    // FIXME: Figure out why this test is failing
+    it.skip('disallows CORS and fetch requests when only supportFetchAPI is specified', async () => {
       await allowsCORSRequests('no-cors', ['failed xhr', 'failed fetch'], /has been blocked by CORS policy/, () => {
         const { ipcRenderer } = require('electron');
         Promise.all([
@@ -915,7 +917,7 @@ describe('protocol module', () => {
         callback('');
       });
 
-      const newContents: WebContents = (webContents as any).create({ nodeIntegration: true });
+      const newContents: WebContents = (webContents as any).create({ nodeIntegration: true, contextIsolation: false });
       const consoleMessages: string[] = [];
       newContents.on('console-message', (e, level, message) => consoleMessages.push(message));
       try {

+ 1 - 1
spec/fixtures/pages/cache-storage.html

@@ -1,5 +1,5 @@
 <script>
-  const ipcRenderer = require('electron').ipcRenderer;
+  const { ipcRenderer } = require('electron');
   caches.open('foo').then(
     () => ipcRenderer.send('success'),
     err => ipcRenderer.send('failure', err)