summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests
diff options
context:
space:
mode:
Diffstat (limited to 'dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests')
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_bgra8unorm.https.html1
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba16float.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba8unorm.https.html1
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_copy.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_draw.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_copy.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_draw.https.html2
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_image_rendering.https.html12
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.html.ts46
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.https.html10
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/canvas_image_rendering-ref.html12
-rw-r--r--dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/delay_get_texture-ref.html17
14 files changed, 94 insertions, 19 deletions
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_bgra8unorm.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_bgra8unorm.https.html
index c910c97b1d..a0068dbf7a 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_bgra8unorm.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_bgra8unorm.https.html
@@ -14,6 +14,7 @@
<link rel="help" href="https://gpuweb.github.io/gpuweb/" />
<meta name="assert" content="WebGPU bgra8norm canvas with colorSpace set should be rendered correctly" />
<link rel="match" href="./ref/canvas_colorspace-ref.html" />
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<script type="module">
import { runColorSpaceTest } from './canvas_colorspace.html.js';
runColorSpaceTest('bgra8unorm');
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba16float.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba16float.https.html
index 7f57858e49..b38fef9591 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba16float.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba16float.https.html
@@ -14,7 +14,7 @@
<link rel="help" href="https://gpuweb.github.io/gpuweb/" />
<meta name="assert" content="WebGPU rgba16float canvas with colorSpace set should be rendered correctly" />
<link rel="match" href="./ref/canvas_colorspace-ref.html" />
- <meta name=fuzzy content="maxDifference=1;totalPixels=8192">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<script type="module">
import { runColorSpaceTest } from './canvas_colorspace.html.js';
runColorSpaceTest('rgba16float');
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba8unorm.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba8unorm.https.html
index e57e04ef5c..404aed360c 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba8unorm.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_colorspace_rgba8unorm.https.html
@@ -14,6 +14,7 @@
<link rel="help" href="https://gpuweb.github.io/gpuweb/" />
<meta name="assert" content="WebGPU rgba8unorm canvas with colorSpace set should be rendered correctly" />
<link rel="match" href="./ref/canvas_colorspace-ref.html" />
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<script type="module">
import { runColorSpaceTest } from './canvas_colorspace.html.js';
runColorSpaceTest('rgba8unorm');
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html
index 70920dc0e6..5c3b888fee 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html
@@ -8,7 +8,7 @@
content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space"
/>
<link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" />
- <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-400">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<style>
body { background-color: #F0E68C; }
#c-canvas { background-color: #8CF0E6; }
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html
index d12751fac2..81335296c0 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html
@@ -8,7 +8,7 @@
content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space"
/>
<link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" />
- <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-400">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<style>
body { background-color: #F0E68C; }
#c-canvas { background-color: #8CF0E6; }
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_copy.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_copy.https.html
index ed722013c1..28e2553fed 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_copy.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_copy.https.html
@@ -8,7 +8,7 @@
content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space"
/>
<link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" />
- <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-400">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<style>
body { background-color: #F0E68C; }
#c-canvas { background-color: #8CF0E6; }
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_draw.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_draw.https.html
index 8a028b168e..ca76fac7cd 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_draw.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_premultiplied_draw.https.html
@@ -8,7 +8,7 @@
content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space"
/>
<link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" />
- <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-400">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<style>
body { background-color: #F0E68C; }
#c-canvas { background-color: #8CF0E6; }
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_copy.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_copy.https.html
index fa938aba41..7936e0b81c 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_copy.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_copy.https.html
@@ -8,7 +8,7 @@
content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space"
/>
<link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" />
- <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-400">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<style>
body { background-color: #F0E68C; }
#c-canvas { background-color: #8CF0E6; }
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_draw.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_draw.https.html
index b62e71054c..da48abd2be 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_draw.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_composite_alpha_rgba8unorm_premultiplied_draw.https.html
@@ -8,7 +8,7 @@
content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space"
/>
<link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" />
- <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-400">
+ <meta name=fuzzy content="maxDifference=0-2;totalPixels=0-9999999">
<style>
body { background-color: #F0E68C; }
#c-canvas { background-color: #8CF0E6; }
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_image_rendering.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_image_rendering.https.html
index f51145645b..6a64b3da5d 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_image_rendering.https.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/canvas_image_rendering.https.html
@@ -5,11 +5,11 @@
<link rel="help" href="https://gpuweb.github.io/gpuweb/" />
<meta name="assert" content="WebGPU canvas with image-rendering set should be rendered correctly" />
<link rel="match" href="./ref/canvas_image_rendering-ref.html" />
- <canvas id="elem1" width="64" height="64" style="width: 99px; height: 99px;"></canvas>
- <canvas id="elem2" width="64" height="64" style="width: 99px; height: 99px; image-rendering: pixelated;"></canvas>
- <canvas id="elem3" width="64" height="64" style="width: 99px; height: 99px; image-rendering: crisp-edges"></canvas>
- <canvas id="elem4" width="64" height="64" style="width: 99px; height: 99px;"></canvas>
- <canvas id="elem5" width="64" height="64" style="width: 99px; height: 99px; image-rendering: pixelated;"></canvas>
- <canvas id="elem6" width="64" height="64" style="width: 99px; height: 99px; image-rendering: crisp-edges"></canvas>
+ <canvas id="elem1" width="64" height="64" style="width: 128px; height: 128px;"></canvas>
+ <canvas id="elem2" width="64" height="64" style="width: 128px; height: 128px; image-rendering: pixelated;"></canvas>
+ <canvas id="elem3" width="64" height="64" style="width: 128px; height: 128px; image-rendering: crisp-edges"></canvas>
+ <canvas id="elem4" width="64" height="64" style="width: 128px; height: 128px;"></canvas>
+ <canvas id="elem5" width="64" height="64" style="width: 128px; height: 128px; image-rendering: pixelated;"></canvas>
+ <canvas id="elem6" width="64" height="64" style="width: 128px; height: 128px; image-rendering: crisp-edges"></canvas>
<script type="module" src="canvas_image_rendering.html.js"></script>
</html>
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.html.ts b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.html.ts
new file mode 100644
index 0000000000..a73216a34e
--- /dev/null
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.html.ts
@@ -0,0 +1,46 @@
+import { timeout } from '../../../common/util/timeout.js';
+import { takeScreenshotDelayed } from '../../../common/util/wpt_reftest_wait.js';
+
+function assert(condition: boolean, msg?: string | (() => string)): asserts condition {
+ if (!condition) {
+ throw new Error(msg && (typeof msg === 'string' ? msg : msg()));
+ }
+}
+
+void (async () => {
+ assert(
+ typeof navigator !== 'undefined' && navigator.gpu !== undefined,
+ 'No WebGPU implementation found'
+ );
+
+ const adapter = await navigator.gpu.requestAdapter();
+ assert(adapter !== null);
+ const device = await adapter.requestDevice();
+ assert(device !== null);
+
+ const canvas = document.getElementById('cvs0') as HTMLCanvasElement;
+ const ctx = canvas.getContext('webgpu') as unknown as GPUCanvasContext;
+ ctx.configure({
+ device,
+ format: navigator.gpu.getPreferredCanvasFormat(),
+ alphaMode: 'premultiplied',
+ });
+
+ timeout(() => {
+ const encoder = device.createCommandEncoder();
+ const pass = encoder.beginRenderPass({
+ colorAttachments: [
+ {
+ view: ctx.getCurrentTexture().createView(),
+ clearValue: { r: 0.0, g: 1.0, b: 0.0, a: 1.0 },
+ loadOp: 'clear',
+ storeOp: 'store',
+ },
+ ],
+ });
+ pass.end();
+ device.queue.submit([encoder.finish()]);
+
+ takeScreenshotDelayed(50);
+ }, 100);
+})();
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.https.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.https.html
new file mode 100644
index 0000000000..054c352ac2
--- /dev/null
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.https.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <title>WebGPU delay getCurrentTexture</title>
+ <meta charset="utf-8" />
+ <link rel="help" href="https://gpuweb.github.io/gpuweb/" />
+ <meta name="assert" content="WebGPU delay calling getCurrentTexture should be presented correctly" />
+ <link rel="match" href="./ref/delay_get_texture-ref.html" />
+ <canvas id="cvs0" width="20" height="20" style="width: 20px; height: 20px;"></canvas>
+ <script type="module" src="delay_get_texture.html.js"></script>
+</html>
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/canvas_image_rendering-ref.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/canvas_image_rendering-ref.html
index f9eca704e8..56e3453c56 100644
--- a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/canvas_image_rendering-ref.html
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/canvas_image_rendering-ref.html
@@ -3,12 +3,12 @@
<title>WebGPU canvas_image_rendering (ref)</title>
<meta charset="utf-8" />
<link rel="help" href="https://gpuweb.github.io/gpuweb/" />
- <img id="elem1" width="64" height="64" style="width: 99px; height: 99px;">
- <img id="elem2" width="64" height="64" style="width: 99px; height: 99px; image-rendering: pixelated;">
- <img id="elem3" width="64" height="64" style="width: 99px; height: 99px; image-rendering: crisp-edges">
- <img id="elem4" width="64" height="64" style="width: 99px; height: 99px;">
- <img id="elem5" width="64" height="64" style="width: 99px; height: 99px; image-rendering: pixelated;">
- <img id="elem6" width="64" height="64" style="width: 99px; height: 99px; image-rendering: crisp-edges">
+ <img id="elem1" width="64" height="64" style="width: 128px; height: 128px;">
+ <img id="elem2" width="64" height="64" style="width: 128px; height: 128px; image-rendering: pixelated;">
+ <img id="elem3" width="64" height="64" style="width: 128px; height: 128px; image-rendering: crisp-edges">
+ <img id="elem4" width="64" height="64" style="width: 128px; height: 128px;">
+ <img id="elem5" width="64" height="64" style="width: 128px; height: 128px; image-rendering: pixelated;">
+ <img id="elem6" width="64" height="64" style="width: 128px; height: 128px; image-rendering: crisp-edges">
<script type="module">
import { takeScreenshotDelayed } from '../../../../common/util/wpt_reftest_wait.js';
diff --git a/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/delay_get_texture-ref.html b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/delay_get_texture-ref.html
new file mode 100644
index 0000000000..fcf485dbe1
--- /dev/null
+++ b/dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/delay_get_texture-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <title>WebGPU delay getCurrentTexture (ref)</title>
+ <meta charset="utf-8" />
+ <link rel="help" href="https://gpuweb.github.io/gpuweb/" />
+ <canvas id="cvs0" width="20" height="20" style="width: 20px; height: 20px;"></canvas>
+ <script>
+ function draw(canvas) {
+ var c = document.getElementById(canvas);
+ var ctx = c.getContext('2d');
+ ctx.fillStyle = '#00FF00';
+ ctx.fillRect(0, 0, c.width, c.height);
+ }
+
+ draw('cvs0');
+ </script>
+</html>