Update webgl conformance tests (#33121)

* Update python -> python3 for helper script.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update webgl conformance testsuite patches.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Import WebGL conformance testsuite for August 19, 2024.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update expected results.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Track the commit used for webgl conformance test import.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2024-11-03 23:27:29 -05:00 committed by GitHub
parent e64831d68a
commit 5d1d3d6b5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4060 changed files with 100141 additions and 90094 deletions

1
tests/wpt/webgl/tools/COMMIT vendored Normal file
View file

@ -0,0 +1 @@
eeeb0204fc382851ac984a348f920e0d99927abb

View file

@ -1,32 +1,31 @@
diff --git a/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html b/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
diff --git a/tests/wpt/webgl/tests/conformance/extensions/s3tc-and-rgtc.html b/tests/wpt/webgl/tests/conformance/extensions/s3tc-and-rgtc.html
index 308e8577a8..ea56180224 100644
--- a/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
+++ b/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
--- a/tests/wpt/webgl/tests/conformance/extensions/s3tc-and-rgtc.html
+++ b/tests/wpt/webgl/tests/conformance/extensions/s3tc-and-rgtc.html
@@ -695,13 +695,6 @@ function compareRect(width, height, channels, expectedData, filteringMode) {
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, actual);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "reading back pixels");
- var div = document.createElement("div");
- div.className = "testimages";
- insertImg(div, "expected", makeImage(width, height, expectedData, channels == 4));
- insertImg(div, "actual", makeImage(width, height, actual, channels == 4));
- ctu.insertCaptionedImg(div, "expected", ctu.makeScaledImage(width, height, width, expectedData, true));
- ctu.insertCaptionedImg(div, "actual", ctu.makeScaledImage(width, height, width, actual, true));
- div.appendChild(document.createElement('br'));
- document.getElementById("console").appendChild(div);
-
var failed = false;
for (var yy = 0; yy < height; ++yy) {
for (var xx = 0; xx < width; ++xx) {
@@ -715,6 +708,13 @@ function compareRect(width, height, channels, expectedData, filteringMode) {
for (var jj = 0; jj < 4; ++jj) {
if (actual[offset + jj] != expected[jj]) {
@@ -715,6 +708,12 @@ function compareRect(width, he ight, channels, expectedData, filteringMode) {
failed = true;
testFailed(`RGB at (${xx}, ${yy}) expected: ${expected}` +
` +/- ${colorError}, was ${was}`);
+ var div = document.createElement("div");
+ div.className = "testimages";
+ insertImg(div, "expected", makeImage(width, height, expectedData, channels == 4));
+ insertImg(div, "actual", makeImage(width, height, actual, channels == 4));
+ ctu.insertCaptionedImg(div, "expected", ctu.makeScaledImage(width, height, width, expectedData, true));
+ ctu.insertCaptionedImg(div, "actual", ctu.makeScaledImage(width, height, width, was, true));
+ div.appendChild(document.createElement('br'));
+ document.getElementById("console").appendChild(div);
+
var was = actual[offset + 0].toString();
for (var j = 1; j < 4; ++j) {
was += "," + actual[offset + j];
break;
}
}

View file

@ -15,14 +15,10 @@ PATCHES = [
("unit.patch", "conformance/more/unit.js"),
("timeout.patch", None),
("set-zero-timeout.patch", "js/webgl-test-utils.js"),
("compressed-images.patch", "conformance/extensions/webgl-compressed-texture-s3tc.html"),
("compressed-images.patch", "conformance/extensions/s3tc-and-rgtc.html"),
("shader-varying-packing-restrictions.patch", "conformance/glsl/misc/shader-varying-packing-restrictions.html"),
]
# Fix for 'UnicodeDecodeError: 'ascii' codec can't decode byte'
reload(sys)
sys.setdefaultencoding('utf8')
def usage():
print("Usage: {} destination [existing_webgl_repo]".format(sys.argv[0]))
sys.exit(1)
@ -58,13 +54,13 @@ def get_tests(base_dir, file_name, tests_list):
def process_test(test):
(new, new_path) = tempfile.mkstemp()
script_tag_found = False
with open(test, "r") as test_file:
with open(test, "rb") as test_file:
for line in test_file:
if not script_tag_found and "<script" in line:
indent = ' ' * line.index('<')
if not script_tag_found and b"<script" in line:
indent = ' ' * line.index(b'<')
script_tag_found = True
os.write(new, "{}<script src=/resources/testharness.js></script>\n".format(indent))
os.write(new, "{}<script src=/resources/testharnessreport.js></script>\n".format(indent))
os.write(new, "{}<script src=/resources/testharness.js></script>\n".format(indent).encode('utf-8'))
os.write(new, "{}<script src=/resources/testharnessreport.js></script>\n".format(indent).encode('utf-8'))
os.write(new, line)
os.close(new)
@ -83,6 +79,11 @@ def update_conformance(destination, existing_repo, patches_dir):
print("Cloning WebGL repository into temporary directory {}".format(directory))
subprocess.check_call(["git", "clone", KHRONOS_REPO_URL, directory, "--depth", "1"])
commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=directory)
commit_path = os.path.join(os.path.dirname(__file__), "COMMIT")
with open(commit_path, 'wb') as f:
f.write(commit)
suite_dir = os.path.join(directory, "sdk/tests")
print("Test suite directory: {}".format(suite_dir))

View file

@ -1,12 +1,17 @@
--- js/js-test-pre.js
+++ js/js-test-pre.js
@@ -106,11 +106,25 @@
}
}
@@ -106,16 +106,25 @@
const locationPathname = window.location.pathname;
const webglTestHarness = window.parent.webglTestHarness;
-function reportTestResultsToHarness(success, msg) {
- if (window.parent.webglTestHarness) {
- window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
- if (success) {
- RESULTS.pass += 1;
- } else {
- RESULTS.fail += 1;
- }
- if (webglTestHarness) {
- webglTestHarness.reportResults(locationPathname, success, msg);
+(function() {
+ var WPT_TEST_ID = 0;
+
@ -17,8 +22,8 @@
+ var wt_async_test = window.async_test;
+
+ window.reportTestResultsToHarness = function reportTestResultsToHarness(success, msg) {
+ if (window.parent.webglTestHarness) {
+ window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
+ if (webglTestHarness) {
+ webglTestHarness.reportResults(locationPathname, success, msg);
+ } else if (wpt_test) { // WPT test harness
+ wpt_test(function () {
+ wpt_assert_true(success, msg);

View file

@ -82,6 +82,8 @@ index c1542f4fa9..b3ee786e0b 100644
<link rel="stylesheet" href="../../resources/js-test-style.css"/>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
diff --git i/conformance/glsl/misc/shader-uniform-packing-restrictions.html w/conformance/glsl/misc/shader-uniform-packing-restrictions.html
index c1542f4fa9..b3ee786e0b 100644
--- i/conformance/glsl/misc/shader-uniform-packing-restrictions.html
+++ w/conformance/glsl/misc/shader-uniform-packing-restrictions.html
@@ -29,6 +29,7 @@
@ -92,10 +94,10 @@ index c1542f4fa9..b3ee786e0b 100644
<title>WebGL uniform packing restrctions Conformance Test</title>
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
diff --git i/conformance/extensions/webgl-compressed-texture-s3tc.html w/conformance/extensions/webgl-compressed-texture-s3tc.html
diff --git i/conformance/extensions/s3tc-and-rgtc.html w/conformance/extensions/s3tc-and-rgtc.html
index 28e3cfc562..308e8577a8 100644
--- i/conformance/extensions/webgl-compressed-texture-s3tc.html
+++ w/conformance/extensions/webgl-compressed-texture-s3tc.html
--- i/conformance/extensions/s3tc-and-rgtc.html
+++ w/conformance/extensions/s3tc-and-rgtc.html
@@ -29,6 +29,7 @@
<html>
<head>
@ -140,18 +142,6 @@ index 535739ff7b..30a734c642 100644
<title>Driver Bug - temp experssions should not crash</title>
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<script src=/resources/testharness.js></script>
diff --git a/conformance/glsl/misc/shader-with-non-reserved-words.html b/conformance/glsl/misc/shader-with-non-reserved-words.html
index 6aee7c6eba..29d891e0d1 100644
--- a/conformance/glsl/misc/shader-with-non-reserved-words.html
+++ b/conformance/glsl/misc/shader-with-non-reserved-words.html
@@ -29,6 +29,7 @@
<html>
<head>
<meta charset="utf-8">
+<meta name="timeout" content="long">
<title>WebGL GLSL Conformance Tests - Non Reserved Words</title>
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
diff --git a/conformance/ogles/GL/atan/atan_001_to_008.html b/conformance/ogles/GL/atan/atan_001_to_008.html
index 96811c9a93..207db792c3 100644
--- a/conformance/ogles/GL/atan/atan_001_to_008.html
@ -1808,10 +1798,10 @@ index a2166e9df7..fb9067f6c2 100644
<title>WebGL GLSL Conformance Tests - Reserved Words</title>
<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
diff --git a/tests/wpt/webgl/tests/conformance/rendering/preservedrawingbuffer-leak.html b/tests/wpt/webgl/tests/conformance/rendering/preservedrawingbuffer-leak.html
diff --git a/conformance/rendering/preservedrawingbuffer-leak.html b/conformance/rendering/preservedrawingbuffer-leak.html
index 3df5355..80571f5 100644
--- a/tests/wpt/webgl/tests/conformance/rendering/preservedrawingbuffer-leak.html
+++ b/tests/wpt/webgl/tests/conformance/rendering/preservedrawingbuffer-leak.html
--- a/conformance/rendering/preservedrawingbuffer-leak.html
+++ b/conformance/rendering/preservedrawingbuffer-leak.html
@@ -29,6 +29,7 @@
<html>
<head>