Skip to content

Commit e604df8

Browse files
committed
Skip tests using HTMLVideoElement when it is undefined.
This avoids failures when running outside of the Web platform, for example in node.js or Deno bindings for WebGPU.
1 parent 1c407e0 commit e604df8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/webgpu/web_platform/util.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ export async function getVideoFrameFromVideoElement(
267267
*
268268
*/
269269
export function getVideoElement(t: GPUTest, videoName: VideoName): HTMLVideoElement {
270+
if (typeof HTMLVideoElement === 'undefined') {
271+
t.skip('HTMLVideoElement not available');
272+
}
273+
270274
const videoElement = document.createElement('video');
271275
const videoInfo = kVideoInfo[videoName];
272276

0 commit comments

Comments
 (0)