Assert expected height

This commit is contained in:
Kevin Sawicki 2016-11-15 13:47:14 -08:00
parent 2986b7bc4a
commit 9e51c779e1

View file

@ -1363,6 +1363,7 @@ describe('<webview> tag', function () {
const elementResizePromise = new Promise(resolve => {
ipcMain.once('webview-element-resize', (event, width, height) => {
assert.equal(width, CONTENT_SIZE)
assert.equal(height, CONTENT_SIZE)
resolve()
})
})
@ -1370,6 +1371,7 @@ describe('<webview> tag', function () {
const guestResizePromise = new Promise(resolve => {
ipcMain.once('webview-guest-resize', (event, width, height) => {
assert.equal(width, CONTENT_SIZE)
assert.equal(height, CONTENT_SIZE)
resolve()
})
})
@ -1390,13 +1392,14 @@ describe('<webview> tag', function () {
const elementResizePromise = new Promise(resolve => {
ipcMain.once('webview-element-resize', (event, width, height) => {
assert.equal(width, CONTENT_SIZE)
assert.equal(height, CONTENT_SIZE)
resolve()
})
})
const noGuestResizePromise = new Promise(resolve => {
const onGuestResize = (event, width, height) => {
assert(false, 'unexpected guest resize message')
done(new Error('Unexpected guest resize message'))
}
ipcMain.once('webview-guest-resize', onGuestResize)
@ -1442,7 +1445,7 @@ describe('<webview> tag', function () {
done()
})
for (let wc of webContents.getAllWebContents()) {
for (const wc of webContents.getAllWebContents()) {
if (wc.hostWebContents &&
wc.hostWebContents.id === w.webContents.id) {
wc.setSize({