Skip to content

Commit

Permalink
Skip tests using HTMLVideoElement when it is undefined. (#3138)
Browse files Browse the repository at this point in the history
This avoids failures when running outside of the Web platform, for
example in node.js or Deno bindings for WebGPU.
  • Loading branch information
Kangz authored Nov 8, 2023
1 parent 5241b4a commit f413d34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/webgpu/web_platform/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ export async function getVideoFrameFromVideoElement(
*
*/
export function getVideoElement(t: GPUTest, videoName: VideoName): HTMLVideoElement {
if (typeof HTMLVideoElement === 'undefined') {
t.skip('HTMLVideoElement not available');
}

const videoElement = document.createElement('video');
const videoInfo = kVideoInfo[videoName];

Expand Down

0 comments on commit f413d34

Please sign in to comment.