test: move remote specs to main process (#21387)

This commit is contained in:
Jeremy Apthorp 2019-12-09 10:27:30 -08:00 committed by GitHub
parent 409ef49d3a
commit 7f6b308bf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 702 additions and 633 deletions

View file

@ -172,41 +172,6 @@ describe('<webview> tag', function () {
})
})
describe('enableremotemodule attribute', () => {
const generateSpecs = (description, sandbox) => {
describe(description, () => {
const preload = `${fixtures}/module/preload-disable-remote.js`
const src = `file://${fixtures}/api/blank.html`
it('enables the remote module by default', async () => {
const message = await startLoadingWebViewAndWaitForMessage(webview, {
preload,
src,
sandbox
})
const typeOfRemote = JSON.parse(message)
expect(typeOfRemote).to.equal('object')
})
it('disables the remote module when false', async () => {
const message = await startLoadingWebViewAndWaitForMessage(webview, {
preload,
src,
sandbox,
enableremotemodule: false
})
const typeOfRemote = JSON.parse(message)
expect(typeOfRemote).to.equal('undefined')
})
})
}
generateSpecs('without sandbox', false)
generateSpecs('with sandbox', true)
})
describe('preload attribute', () => {
it('loads the script before other scripts in window', async () => {
const message = await startLoadingWebViewAndWaitForMessage(webview, {