<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./webgpu-helpers.js"></script>
</head>
<h1>Canvas2D WebGPU Transfer: transferBackFromGPUTexture-context-lost</h1>
<p>transferBackFromGPUTexture() should be a no-op if the canvas context is lost.
</p>
<canvas id="c" width="50" height="50"></canvas>
<script>
promise_test(() => {
return with_webgpu((adapter, adapterInfo, device) => {
return test_transferBackFromGPUTexture_context_lost(
device,
document.getElementById('c'),
{});
});
},
'transferBackFromGPUTexture() should be a no-op if the 2D context is lost.'
);
promise_test(() => {
return with_webgpu((adapter, adapterInfo, device) => {
return test_transferBackFromGPUTexture_context_lost(
device,
new OffscreenCanvas(50, 50),
{});
});
},
'transferBackFromGPUTexture() should be a no-op if the offscreen context ' +
'is lost.'
);
</script>