feat: enable native extensions support (#21814)

This commit is contained in:
Jeremy Apthorp 2020-02-03 14:01:10 -08:00 committed by GitHub
parent bdf65a75d0
commit a061c87e56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 1054 additions and 941 deletions

View file

@ -162,10 +162,12 @@ describe('<webview> tag', function () {
BrowserWindow.removeDevToolsExtension('foo')
const extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
BrowserWindow.addDevToolsExtension(extensionPath)
await BrowserWindow.addDevToolsExtension(extensionPath)
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'webview-devtools.html'))
let childWebContentsId = 0
app.once('web-contents-created', (e, webContents) => {
childWebContentsId = webContents.id
webContents.on('devtools-opened', function () {
const showPanelIntervalId = setInterval(function () {
if (!webContents.isDestroyed() && webContents.devToolsWebContents) {
@ -181,8 +183,8 @@ describe('<webview> tag', function () {
})
const [, { runtimeId, tabId }] = await emittedOnce(ipcMain, 'answer')
expect(runtimeId).to.equal('foo')
expect(tabId).to.be.not.equal(w.webContents.id)
expect(runtimeId).to.match(/^[a-z]{32}$/)
expect(tabId).to.equal(childWebContentsId)
})
describe('zoom behavior', () => {