test: skip PictureInPicture video when media not supported (#27235)

Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
trop[bot]
2021-01-07 21:38:48 -08:00
committed by GitHub
parent bf0b82dc8e
commit 8afd7877f6

View File

@@ -1785,9 +1785,14 @@ describe('webContents module', () => {
describe('PictureInPicture video', () => {
afterEach(closeAllWindows);
it('works as expected', async () => {
it('works as expected', async function () {
const w = new BrowserWindow({ show: false, webPreferences: { sandbox: true } });
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(
`runTest(${features.isPictureInPictureEnabled()})`, true);
expect(result).to.be.true();