chromium/third_party/blink/web_tests/wpt_internal/webgpu/canvas_webgpu_transfer/transferBackFromGPUTexture-destroys-texture.https.html

<!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-destroys-texture</h1>

<p>transferBackFromGPUTexture() causes the GPUTexture returned by
transferToGPUTexture() to enter a destroyed state.</p>

<canvas id="c" width="50" height="50"></canvas>

<script>

promise_test(() => {
    return with_webgpu((adapter, adapterInfo, device) => {
      return test_transferBackFromGPUTexture_destroys_texture(
                 device,
                 document.getElementById('c'));
    });
  },
  'transferBackFromGPUTexture() should destroy the associated GPUTexture.'
);

promise_test(() => {
    return with_webgpu((adapter, adapterInfo, device) => {
      return test_transferBackFromGPUTexture_destroys_texture(
                 device,
                 new OffscreenCanvas(50, 50));
    });
  },
  'transferBackFromGPUTexture() on an offscreen canvas should destroy the ' +
  'associated GPUTexture.'
);

</script>