DRY up specs
This commit is contained in:
parent
77b074fbad
commit
7db2601ea8
1 changed files with 17 additions and 26 deletions
|
@ -825,12 +825,11 @@ describe('browser-window module', function () {
|
||||||
|
|
||||||
describe('dev tool extensions', function () {
|
describe('dev tool extensions', function () {
|
||||||
describe('BrowserWindow.addDevToolsExtension', function () {
|
describe('BrowserWindow.addDevToolsExtension', function () {
|
||||||
|
this.timeout(10000)
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
BrowserWindow.removeDevToolsExtension('foo')
|
BrowserWindow.removeDevToolsExtension('foo')
|
||||||
})
|
|
||||||
|
|
||||||
describe('when the devtools is docked', function () {
|
|
||||||
it('creates the extension', function (done) {
|
|
||||||
var extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
|
var extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
|
||||||
BrowserWindow.addDevToolsExtension(extensionPath)
|
BrowserWindow.addDevToolsExtension(extensionPath)
|
||||||
|
|
||||||
|
@ -841,9 +840,14 @@ describe('browser-window module', function () {
|
||||||
} else {
|
} else {
|
||||||
clearInterval(inputEventIntervalId)
|
clearInterval(inputEventIntervalId)
|
||||||
}
|
}
|
||||||
}, 250)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
||||||
w.loadURL('about:blank')
|
w.loadURL('about:blank')
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('when the devtools is docked', function () {
|
||||||
|
it('creates the extension', function (done) {
|
||||||
w.webContents.openDevTools({mode: 'bottom'})
|
w.webContents.openDevTools({mode: 'bottom'})
|
||||||
|
|
||||||
ipcMain.once('answer', function (event, message) {
|
ipcMain.once('answer', function (event, message) {
|
||||||
|
@ -855,19 +859,6 @@ describe('browser-window module', function () {
|
||||||
|
|
||||||
describe('when the devtools is undocked', function () {
|
describe('when the devtools is undocked', function () {
|
||||||
it('creates the extension', function (done) {
|
it('creates the extension', function (done) {
|
||||||
var extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
|
|
||||||
BrowserWindow.addDevToolsExtension(extensionPath)
|
|
||||||
|
|
||||||
w.webContents.on('devtools-opened', () => {
|
|
||||||
var inputEventIntervalId = setInterval(function () {
|
|
||||||
if (w && w.devToolsWebContents) {
|
|
||||||
w.devToolsWebContents.sendInputEvent({type: 'keyDown', keyCode:'[', modifiers: ['meta']})
|
|
||||||
} else {
|
|
||||||
clearInterval(inputEventIntervalId)
|
|
||||||
}
|
|
||||||
}, 250)
|
|
||||||
})
|
|
||||||
w.loadURL('about:blank')
|
|
||||||
w.webContents.openDevTools({mode: 'undocked'})
|
w.webContents.openDevTools({mode: 'undocked'})
|
||||||
|
|
||||||
ipcMain.once('answer', function (event, message) {
|
ipcMain.once('answer', function (event, message) {
|
||||||
|
|
Loading…
Reference in a new issue