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

* test: re-enable some skipped tests

* test: enable more tests
This commit is contained in:
David Sanders 2021-06-14 18:55:08 -07:00 committed by GitHub
parent f022ead559
commit 214fcfc46d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View file

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

View file

@ -754,7 +754,7 @@ describe('protocol module', () => {
}); });
}); });
describe.skip('protocol.registerSchemesAsPrivileged standard', () => { describe('protocol.registerSchemesAsPrivileged standard', () => {
const standardScheme = (global as any).standardScheme; const standardScheme = (global as any).standardScheme;
const origin = `${standardScheme}://fake-host`; const origin = `${standardScheme}://fake-host`;
const imageURL = `${origin}/test.png`; const imageURL = `${origin}/test.png`;
@ -766,7 +766,8 @@ describe('protocol module', () => {
w = new BrowserWindow({ w = new BrowserWindow({
show: false, show: false,
webPreferences: { 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; const standardScheme = (global as any).standardScheme;
let w: BrowserWindow = null as unknown as BrowserWindow; let w: BrowserWindow = null as unknown as BrowserWindow;
beforeEach(async () => { 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/, () => { await allowsCORSRequests('no-cors', ['failed xhr', 'failed fetch'], /has been blocked by CORS policy/, () => {
const { ipcRenderer } = require('electron'); const { ipcRenderer } = require('electron');
Promise.all([ Promise.all([
@ -915,7 +917,7 @@ describe('protocol module', () => {
callback(''); callback('');
}); });
const newContents: WebContents = (webContents as any).create({ nodeIntegration: true }); const newContents: WebContents = (webContents as any).create({ nodeIntegration: true, contextIsolation: false });
const consoleMessages: string[] = []; const consoleMessages: string[] = [];
newContents.on('console-message', (e, level, message) => consoleMessages.push(message)); newContents.on('console-message', (e, level, message) => consoleMessages.push(message));
try { try {

View file

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