[WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator
[WebKit-https.git] / LayoutTests / webgpu / js / create-worker-device.js
1 async function tryCreateDevice() {
2     if (!navigator.gpu)
3         postMessage(false);
4
5     const adapter = await navigator.gpu.requestAdapter();
6     await adapter.requestDevice();
7
8     postMessage(true);
9 }
10
11 tryCreateDevice();