Browse Source

test: skip protocol.registerSchemesAsPrivileged stream test when media not supported (#27229)

Co-authored-by: Milan Burda <[email protected]>
trop[bot] 4 years ago
parent
commit
cb281b7954
1 changed files with 5 additions and 1 deletions
  1. 5 1
      spec-main/api-protocol-spec.ts

+ 5 - 1
spec-main/api-protocol-spec.ts

@@ -908,8 +908,12 @@ describe('protocol module', () => {
       await fs.promises.unlink(videoPath);
     });
 
-    beforeEach(async () => {
+    beforeEach(async function () {
       w = new BrowserWindow({ show: false });
+      await w.loadURL('about:blank');
+      if (!await w.webContents.executeJavaScript('document.createElement(\'video\').canPlayType(\'video/webm; codecs="vp8.0"\')')) {
+        this.skip();
+      }
     });
 
     afterEach(async () => {