})
it('does not crash in did-fail-provisional-load handler', function (done) {
- this.timeout(10000)
w.webContents.once('did-fail-provisional-load', function () {
w.loadURL('http://127.0.0.1:11111')
done()
})
it('emits when window is shown', function (done) {
- this.timeout(10000)
w.once('show', function () {
assert.equal(w.isVisible(), true)
done()
})
it('emits when window is hidden', function (done) {
- this.timeout(10000)
w.show()
w.once('hide', function () {
assert.equal(w.isVisible(), false)
})
it('emits when link with target is called', function (done) {
- this.timeout(10000)
w.webContents.once('new-window', function (e, url, frameName) {
e.preventDefault()
assert.equal(url, 'http://host/')
}
it('emits when window is maximized', function (done) {
- this.timeout(10000)
w.once('maximize', function () {
done()
})
}
it('emits when window is unmaximized', function (done) {
- this.timeout(10000)
w.once('unmaximize', function () {
done()
})
}
it('emits when window is minimized', function (done) {
- this.timeout(10000)
w.once('minimize', function () {
done()
})
// This test is too slow, only test it on CI.
if (!isCI) return
- this.timeout(20000)
-
it('subscribes to frame updates', function (done) {
let called = false
w.loadURL('file://' + fixtures + '/api/frame-subscriber.html')
describe('dev tool extensions', function () {
describe('BrowserWindow.addDevToolsExtension', function () {
let showPanelIntevalId
- this.timeout(10000)
beforeEach(function () {
BrowserWindow.removeDevToolsExtension('foo')
})
it('works when used with partitions', function (done) {
- this.timeout(10000)
-
if (w != null) {
w.destroy()
}
})
describe('offscreen rendering', function () {
- this.timeout(10000)
-
beforeEach(function () {
if (w != null) w.destroy()
w = new BrowserWindow({
describe('sending request of http protocol urls', function () {
it('does not crash', function (done) {
- this.timeout(5000)
-
var server = http.createServer(function (req, res) {
res.end()
server.close()
xdescribe('navigator.webkitGetUserMedia', function () {
it('calls its callbacks', function (done) {
- this.timeout(5000)
-
navigator.webkitGetUserMedia({
audio: true,
video: false
})
describe('window.opener', function () {
- this.timeout(10000)
-
let url = 'file://' + fixtures + '/pages/window-opener.html'
let w = null
})
describe('window.opener access from BrowserWindow', function () {
- this.timeout(10000)
-
const scheme = 'other'
let url = `${scheme}://${fixtures}/pages/window-opener-location.html`
let w = null
})
describe('window.opener access from <webview>', function () {
- this.timeout(10000)
-
const scheme = 'other'
const srcPath = `${fixtures}/pages/webview-opener-postMessage.html`
const pageURL = `file://${fixtures}/pages/window-opener-location.html`