Skip to content

Commit 1932994

Browse files
Revert "Migrate Canvas WebGPU Access tests into WebGPU test directory."
This reverts commit 6c77ac02651792a760cc775c1ef5a2981654e9ba. Reason for revert: mysterious failures in `wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_rgba16float_opaque_copy.https.html` since landing Original change's description: > Migrate Canvas WebGPU Access tests into WebGPU test directory. > > The Chromium CQ doesn't enable WebGPU when running the Canvas2D tests > in wpt/external, so the tests can't live there. The WebGPU team has > an internal directory that they use for testing which we can use here > instead. > > We can no longer use the canvas Jinja/YAML framework to assemble > tests outside of the external html/canvas directory, so I've > cobbled together plain HTML pages for these tests instead. > Fortunately the boilerplate is pretty minimal, since we can still > rely on testharness.js. > > Bug: 41490345 > Change-Id: I4cec7a1a65a04c850ec896adad359a28f93aaff8 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5356238 > Commit-Queue: John Stiles <[email protected]> > Auto-Submit: John Stiles <[email protected]> > Reviewed-by: Kai Ninomiya <[email protected]> > Commit-Queue: Kai Ninomiya <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1271074} Bug: 41490345 Change-Id: I608b5784bd81128d44de4462365c654b4426e8e2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5361490 Commit-Queue: Rubber Stamper <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Auto-Submit: John Stiles <[email protected]> Cr-Commit-Position: refs/heads/main@{#1271185}
1 parent 25f2898 commit 1932994

10 files changed

+163
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3+
<title>Canvas test: 2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/html/canvas/resources/canvas-tests.js"></script>
7+
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
8+
<body class="show_output">
9+
10+
<h1>2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https</h1>
11+
<p class="desc">getTextureFormat() returns RGBA16F for a float16 context</p>
12+
13+
14+
<p class="output">Actual output:</p>
15+
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
16+
17+
<ul id="d"></ul>
18+
<script>
19+
var t = async_test("getTextureFormat() returns RGBA16F for a float16 context");
20+
_addTest(function(canvas, ctx) {
21+
22+
_assertSame(ctx.getTextureFormat(), "rgba16float", "ctx.getTextureFormat()", "\"rgba16float\"");
23+
24+
}, {colorSpace: "display-p3", pixelFormat: "float16"});
25+
</script>
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3+
<title>Canvas test: 2d.webgpuaccess.getTextureFormat.rgba8.tentative.https</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/html/canvas/resources/canvas-tests.js"></script>
7+
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
8+
<body class="show_output">
9+
10+
<h1>2d.webgpuaccess.getTextureFormat.rgba8.tentative.https</h1>
11+
<p class="desc">getTextureFormat() returns RGBA8 or BGRA8 for a typical context</p>
12+
13+
14+
<p class="output">Actual output:</p>
15+
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
16+
17+
<ul id="d"></ul>
18+
<script>
19+
var t = async_test("getTextureFormat() returns RGBA8 or BGRA8 for a typical context");
20+
_addTest(function(canvas, ctx) {
21+
22+
assert_regexp_match(ctx.getTextureFormat(), /^rgba8unorm|bgra8unorm$/);
23+
24+
});
25+
</script>
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3+
<title>OffscreenCanvas test: 2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/html/canvas/resources/canvas-tests.js"></script>
7+
8+
<h1>2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https</h1>
9+
<p class="desc">getTextureFormat() returns RGBA16F for a float16 context</p>
10+
11+
12+
<script>
13+
var t = async_test("getTextureFormat() returns RGBA16F for a float16 context");
14+
var t_pass = t.done.bind(t);
15+
var t_fail = t.step_func(function(reason) {
16+
throw reason;
17+
});
18+
t.step(function() {
19+
20+
var canvas = new OffscreenCanvas(100, 50);
21+
var ctx = canvas.getContext('2d', {colorSpace: "display-p3", pixelFormat: "float16"});
22+
23+
_assertSame(ctx.getTextureFormat(), "rgba16float", "ctx.getTextureFormat()", "\"rgba16float\"");
24+
t.done();
25+
26+
});
27+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
2+
// OffscreenCanvas test in a worker:2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https
3+
// Description:getTextureFormat() returns RGBA16F for a float16 context
4+
// Note:
5+
6+
importScripts("/resources/testharness.js");
7+
importScripts("/html/canvas/resources/canvas-tests.js");
8+
9+
var t = async_test("getTextureFormat() returns RGBA16F for a float16 context");
10+
var t_pass = t.done.bind(t);
11+
var t_fail = t.step_func(function(reason) {
12+
throw reason;
13+
});
14+
t.step(function() {
15+
16+
var canvas = new OffscreenCanvas(100, 50);
17+
var ctx = canvas.getContext('2d', {colorSpace: "display-p3", pixelFormat: "float16"});
18+
19+
_assertSame(ctx.getTextureFormat(), "rgba16float", "ctx.getTextureFormat()", "\"rgba16float\"");
20+
t.done();
21+
});
22+
done();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3+
<title>OffscreenCanvas test: 2d.webgpuaccess.getTextureFormat.rgba8.tentative.https</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/html/canvas/resources/canvas-tests.js"></script>
7+
8+
<h1>2d.webgpuaccess.getTextureFormat.rgba8.tentative.https</h1>
9+
<p class="desc">getTextureFormat() returns RGBA8 or BGRA8 for a typical context</p>
10+
11+
12+
<script>
13+
var t = async_test("getTextureFormat() returns RGBA8 or BGRA8 for a typical context");
14+
var t_pass = t.done.bind(t);
15+
var t_fail = t.step_func(function(reason) {
16+
throw reason;
17+
});
18+
t.step(function() {
19+
20+
var canvas = new OffscreenCanvas(100, 50);
21+
var ctx = canvas.getContext('2d');
22+
23+
assert_regexp_match(ctx.getTextureFormat(), /^rgba8unorm|bgra8unorm$/);
24+
t.done();
25+
26+
});
27+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
2+
// OffscreenCanvas test in a worker:2d.webgpuaccess.getTextureFormat.rgba8.tentative.https
3+
// Description:getTextureFormat() returns RGBA8 or BGRA8 for a typical context
4+
// Note:
5+
6+
importScripts("/resources/testharness.js");
7+
importScripts("/html/canvas/resources/canvas-tests.js");
8+
9+
var t = async_test("getTextureFormat() returns RGBA8 or BGRA8 for a typical context");
10+
var t_pass = t.done.bind(t);
11+
var t_fail = t.step_func(function(reason) {
12+
throw reason;
13+
});
14+
t.step(function() {
15+
16+
var canvas = new OffscreenCanvas(100, 50);
17+
var ctx = canvas.getContext('2d');
18+
19+
assert_regexp_match(ctx.getTextureFormat(), /^rgba8unorm|bgra8unorm$/);
20+
t.done();
21+
});
22+
done();

html/canvas/tools/name2dir-canvas.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
2d.video: "video"
2525
2d.canvas.host: "canvas-host"
2626
2d.canvas.context: "canvas-context"
27+
2d.webgpuaccess: "webgpu-access"

html/canvas/tools/name2dir-offscreen.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
2d.voidreturn: "conformance-requirements"
2121
2d.canvas.host: "canvas-host"
2222
2d.canvas.context: "canvas-context"
23+
2d.webgpuaccess: "webgpu-access"

html/canvas/tools/name2dir.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
2d.video: "video"
2424
2d.canvas.host: "canvas-host"
2525
2d.canvas.context: "canvas-context"
26+
2d.webgpuaccess: "webgpu-access"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
- name: 2d.webgpuaccess.getTextureFormat.rgba8.tentative.https
2+
desc: getTextureFormat() returns RGBA8 or BGRA8 for a typical context
3+
code: |
4+
@assert ctx.getTextureFormat() =~ /^rgba8unorm|bgra8unorm$/;
5+
6+
- name: 2d.webgpuaccess.getTextureFormat.rgba16f.tentative.https
7+
desc: getTextureFormat() returns RGBA16F for a float16 context
8+
attributes: '{colorSpace: "display-p3", pixelFormat: "float16"}'
9+
code: |
10+
@assert ctx.getTextureFormat() === "rgba16float";

0 commit comments

Comments
 (0)