feat: enable picture-in-picture mode for video tags (#17686)
* feat: enable picture in picture mode for video tags * test: add test to verify picture in picture support * lint: fix indent * fix: clean up after rebase * test: update test with 16:9 test video * fix: .paches after rebase
This commit is contained in:
parent
46b6bcd99b
commit
9ccd6aa0dd
15 changed files with 318 additions and 0 deletions
|
@ -1273,4 +1273,23 @@ describe('webContents module', () => {
|
|||
expect(data).to.be.an.instanceof(Buffer).that.is.not.empty()
|
||||
})
|
||||
})
|
||||
|
||||
describe('PictureInPicture video', () => {
|
||||
it('works as expected', (done) => {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
sandbox: true
|
||||
}
|
||||
})
|
||||
w.webContents.once('did-finish-load', async () => {
|
||||
const result = await w.webContents.executeJavaScript(
|
||||
`runTest(${features.isPictureInPictureEnabled()})`, true)
|
||||
expect(result).to.be.true()
|
||||
done()
|
||||
})
|
||||
w.loadFile(path.join(fixtures, 'api', 'picture-in-picture.html'))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue