test: remove some remote usage from chromium specs (#20121)

* test: remove remote usage from chromium specs

* disable tts test

* port navigator.mediaDevices tests

* fake camera and microphone

* Update spec-main/chromium-spec.ts

Co-Authored-By: John Kleinschmidt <jkleinsc@github.com>
This commit is contained in:
Jeremy Apthorp 2019-10-11 13:55:50 -07:00 committed by GitHub
parent 1b2c6a33b3
commit 2aa7ab821c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 420 additions and 462 deletions

View file

@ -75,11 +75,6 @@ ipcMain.on('echo', function (event, msg) {
global.setTimeoutPromisified = util.promisify(setTimeout)
global.permissionChecks = {
allow: () => electron.session.defaultSession.setPermissionCheckHandler(null),
reject: () => electron.session.defaultSession.setPermissionCheckHandler(() => false)
}
global.isCi = !!argv.ci
if (global.isCi) {
process.removeAllListeners('uncaughtException')
@ -185,21 +180,6 @@ ipcMain.on('set-client-certificate-option', function (event, skip) {
event.returnValue = 'done'
})
ipcMain.on('create-window-with-options-cycle', (event) => {
// This can't be done over remote since cycles are already
// nulled out at the IPC layer
const foo = {}
foo.bar = foo
foo.baz = {
hello: {
world: true
}
}
foo.baz2 = foo.baz
const window = new BrowserWindow({ show: false, foo: foo })
event.returnValue = window.id
})
ipcMain.on('prevent-next-will-attach-webview', (event) => {
event.sender.once('will-attach-webview', event => event.preventDefault())
})