test: skip PictureInPicture video when media not supported (#27218)
This commit is contained in:
parent
c29923ae8a
commit
904d2ff4cc
1 changed files with 6 additions and 1 deletions
|
@ -1787,9 +1787,14 @@ describe('webContents module', () => {
|
||||||
|
|
||||||
describe('PictureInPicture video', () => {
|
describe('PictureInPicture video', () => {
|
||||||
afterEach(closeAllWindows);
|
afterEach(closeAllWindows);
|
||||||
it('works as expected', async () => {
|
it('works as expected', async function () {
|
||||||
const w = new BrowserWindow({ show: false, webPreferences: { sandbox: true } });
|
const w = new BrowserWindow({ show: false, webPreferences: { sandbox: true } });
|
||||||
await w.loadFile(path.join(fixturesPath, 'api', 'picture-in-picture.html'));
|
await w.loadFile(path.join(fixturesPath, 'api', 'picture-in-picture.html'));
|
||||||
|
|
||||||
|
if (!await w.webContents.executeJavaScript('document.createElement(\'video\').canPlayType(\'video/webm; codecs="vp8.0"\')')) {
|
||||||
|
this.skip();
|
||||||
|
}
|
||||||
|
|
||||||
const result = await w.webContents.executeJavaScript(
|
const result = await w.webContents.executeJavaScript(
|
||||||
`runTest(${features.isPictureInPictureEnabled()})`, true);
|
`runTest(${features.isPictureInPictureEnabled()})`, true);
|
||||||
expect(result).to.be.true();
|
expect(result).to.be.true();
|
||||||
|
|
Loading…
Reference in a new issue