spec: rewrite and enable a webview's disableguestresize attr test (#13428)
This commit is contained in:
parent
4255384abc
commit
f4039d82c3
1 changed files with 5 additions and 9 deletions
|
@ -1547,25 +1547,21 @@ describe('<webview> tag', function () {
|
||||||
return noGuestResizePromise
|
return noGuestResizePromise
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO(alexeykuzmin): [Ch66] Enable the test.
|
it('dispatches element resize event even when attribute is present', async () => {
|
||||||
xit('dispatches element resize event even when attribute is present', async () => {
|
|
||||||
const INITIAL_SIZE = 200
|
const INITIAL_SIZE = 200
|
||||||
const w = await openTheWindow(
|
const w = await openTheWindow(
|
||||||
{show: false, width: INITIAL_SIZE, height: INITIAL_SIZE})
|
{show: false, width: INITIAL_SIZE, height: INITIAL_SIZE})
|
||||||
w.loadURL(`file://${fixtures}/pages/webview-no-guest-resize.html`)
|
w.loadURL(`file://${fixtures}/pages/webview-no-guest-resize.html`)
|
||||||
await emittedOnce(ipcMain, 'webview-loaded')
|
await emittedOnce(ipcMain, 'webview-loaded')
|
||||||
|
|
||||||
const elementResizePromise = emittedOnce(ipcMain, 'webview-element-resize')
|
const whenElementResized = emittedOnce(ipcMain, 'webview-element-resize')
|
||||||
.then(([, width, height]) => {
|
|
||||||
expect(width).to.equal(CONTENT_SIZE)
|
|
||||||
expect(height).to.equal(CONTENT_SIZE)
|
|
||||||
})
|
|
||||||
|
|
||||||
const CONTENT_SIZE = 300
|
const CONTENT_SIZE = 300
|
||||||
assert(CONTENT_SIZE !== INITIAL_SIZE)
|
assert(CONTENT_SIZE !== INITIAL_SIZE)
|
||||||
w.setContentSize(CONTENT_SIZE, CONTENT_SIZE)
|
w.setContentSize(CONTENT_SIZE, CONTENT_SIZE)
|
||||||
|
const [, width, height] = await whenElementResized
|
||||||
|
|
||||||
return elementResizePromise
|
expect(width).to.equal(CONTENT_SIZE)
|
||||||
|
expect(height).to.equal(CONTENT_SIZE)
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO(alexeykuzmin): [Ch66] Enable the test.
|
// TODO(alexeykuzmin): [Ch66] Enable the test.
|
||||||
|
|
Loading…
Reference in a new issue