chore: remove unused BrowserWindow.fromDevToolsWebContents (#19090)

This commit is contained in:
Jeremy Apthorp 2019-07-03 12:07:47 -07:00 committed by John Kleinschmidt
parent 8782d06ed6
commit d1292833e9
2 changed files with 0 additions and 27 deletions

View file

@ -127,15 +127,6 @@ BrowserWindow.fromBrowserView = (browserView) => {
return null
}
BrowserWindow.fromDevToolsWebContents = (webContents) => {
for (const window of BrowserWindow.getAllWindows()) {
const { devToolsWebContents } = window
if (devToolsWebContents != null && devToolsWebContents.equal(webContents)) {
return window
}
}
}
// Helpers.
Object.assign(BrowserWindow.prototype, {
loadURL (...args) {

View file

@ -233,24 +233,6 @@ describe('BrowserWindow module', () => {
})
})
describe('BrowserWindow.fromDevToolsWebContents(webContents)', () => {
let contents = null
beforeEach(() => { contents = webContents.create({}) })
afterEach(() => { contents.destroy() })
it('returns the window with the webContents', (done) => {
w.webContents.once('devtools-opened', () => {
expect(BrowserWindow.fromDevToolsWebContents(w.devToolsWebContents).id).to.equal(w.id)
expect(BrowserWindow.fromDevToolsWebContents(w.webContents)).to.be.undefined()
expect(BrowserWindow.fromDevToolsWebContents(contents)).to.be.undefined()
done()
})
w.webContents.openDevTools()
})
})
describe('BrowserWindow.openDevTools()', () => {
it('does not crash for frameless window', () => {
w.destroy()