Merge remote-tracking branch 'origin/chromium-upgrade/72'

This commit is contained in:
Samuel Attard 2019-01-22 12:01:18 -08:00
commit f3e30c7ae3
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
178 changed files with 2102 additions and 1734 deletions

View file

@ -2117,7 +2117,8 @@ describe('BrowserWindow module', () => {
})
})
describe('document.visibilityState/hidden', () => {
// visibilitychange event is broken upstream, see crbug.com/920839
xdescribe('document.visibilityState/hidden', () => {
beforeEach(() => { w.destroy() })
function onVisibilityChange (callback) {

View file

@ -562,6 +562,19 @@ describe('session module', () => {
it('allows configuring proxy settings', (done) => {
const config = { proxyRules: 'http=myproxy:80' }
customSession.setProxy(config, () => {
customSession.resolveProxy('http://example.com/', (proxy) => {
assert.strictEqual(proxy, 'PROXY myproxy:80')
done()
})
})
})
it('allows removing the implicit bypass rules for localhost', (done) => {
const config = {
proxyRules: 'http=myproxy:80',
proxyBypassRules: '<-loopback>'
}
customSession.setProxy(config, () => {
customSession.resolveProxy('http://localhost', (proxy) => {
assert.strictEqual(proxy, 'PROXY myproxy:80')
@ -599,7 +612,7 @@ describe('session module', () => {
proxyBypassRules: '<local>'
}
customSession.setProxy(config, () => {
customSession.resolveProxy('http://localhost', (proxy) => {
customSession.resolveProxy('http://example/', (proxy) => {
assert.strictEqual(proxy, 'DIRECT')
done()
})

View file

@ -264,7 +264,9 @@ describe('webContents module', () => {
describe('openDevTools() API', () => {
it('can show window with activation', async () => {
const focused = emittedOnce(w, 'focus')
w.show()
await focused
assert.strictEqual(w.isFocused(), true)
const devtoolsOpened = emittedOnce(w.webContents, 'devtools-opened')
w.webContents.openDevTools({ mode: 'detach', activate: true })

View file

@ -1332,10 +1332,12 @@ describe('<webview> tag', function () {
nodeIntegration: true
}
})
const didAttachWebview = emittedOnce(w.webContents, 'did-attach-webview')
const webviewDomReady = emittedOnce(ipcMain, 'webview-dom-ready')
w.loadFile(path.join(fixtures, 'pages', 'webview-did-attach-event.html'))
const [, webContents] = await emittedOnce(w.webContents, 'did-attach-webview')
const [, id] = await emittedOnce(ipcMain, 'webview-dom-ready')
const [, webContents] = await didAttachWebview
const [, id] = await webviewDomReady
expect(webContents.id).to.equal(id)
})
})