mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: skip PictureInPicture video when media not supported (#27267)
This commit is contained in:
@@ -1652,15 +1652,17 @@ describe('webContents module', () => {
|
||||
|
||||
describe('PictureInPicture video', () => {
|
||||
afterEach(closeAllWindows);
|
||||
it('works as expected', (done) => {
|
||||
it('works as expected', async function () {
|
||||
const 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(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(
|
||||
`runTest(${features.isPictureInPictureEnabled()})`, true);
|
||||
expect(result).to.be.true();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user