mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Add WebGL conformance 2.0.0 patches
This commit is contained in:
parent
edb2db55b7
commit
90f657757f
3 changed files with 94 additions and 3 deletions
|
@ -934,7 +934,7 @@ testing/web-platform/mozilla/tests for Servo-only tests""" % reference_path)
|
||||||
@Command('update-webgl',
|
@Command('update-webgl',
|
||||||
description='Update the WebGL conformance suite tests from Khronos repo',
|
description='Update the WebGL conformance suite tests from Khronos repo',
|
||||||
category='testing')
|
category='testing')
|
||||||
@CommandArgument('--version', action='store_true', default='1.0.3',
|
@CommandArgument('--version', default='2.0.0',
|
||||||
help='WebGL conformance suite version')
|
help='WebGL conformance suite version')
|
||||||
def update_webgl(self, version=None):
|
def update_webgl(self, version=None):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
|
|
|
@ -9,10 +9,16 @@ import bisect
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
KHRONOS_REPO_URL = "https://github.com/KhronosGroup/WebGL.git"
|
KHRONOS_REPO_URL = "https://github.com/KhronosGroup/WebGL.git"
|
||||||
PATCHES = [
|
# Patches for conformance tests 1.0.x
|
||||||
|
PATCHES_1X = [
|
||||||
("js-test-pre.patch", "resources/js-test-pre.js"),
|
("js-test-pre.patch", "resources/js-test-pre.js"),
|
||||||
("unit.patch", "conformance/more/unit.js")
|
("unit.patch", "conformance/more/unit.js")
|
||||||
]
|
]
|
||||||
|
# Patches for conformance tests 2.0.x
|
||||||
|
PATCHES_2X = [
|
||||||
|
("js-test-pre2.patch", "js/js-test-pre.js"),
|
||||||
|
("unit.patch", "conformance/more/unit.js")
|
||||||
|
]
|
||||||
|
|
||||||
# Fix for 'UnicodeDecodeError: 'ascii' codec can't decode byte'
|
# Fix for 'UnicodeDecodeError: 'ascii' codec can't decode byte'
|
||||||
reload(sys)
|
reload(sys)
|
||||||
|
@ -124,7 +130,8 @@ def update_conformance(version, destination, existing_repo, patches_dir):
|
||||||
# Try to apply the patches to the required files
|
# Try to apply the patches to the required files
|
||||||
if not patches_dir:
|
if not patches_dir:
|
||||||
patches_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
patches_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||||
for patch, file_name in PATCHES:
|
patches = PATCHES_2X if version.startswith('2') else PATCHES_1X
|
||||||
|
for patch, file_name in patches:
|
||||||
try:
|
try:
|
||||||
patch = os.path.join(patches_dir, patch)
|
patch = os.path.join(patches_dir, patch)
|
||||||
subprocess.check_call(["patch", "-d", destination, file_name, patch])
|
subprocess.check_call(["patch", "-d", destination, file_name, patch])
|
||||||
|
|
84
tests/wpt/mozilla/tests/webgl/tools/js-test-pre2.patch
Normal file
84
tests/wpt/mozilla/tests/webgl/tools/js-test-pre2.patch
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
diff --git a/conformance-suites/2.0.0/js/js-test-pre.js b/conformance-suites/2.0.0/js/js-test-pre.js
|
||||||
|
index df30a6f..7ca8559 100644
|
||||||
|
--- a/conformance-suites/2.0.0/js/js-test-pre.js
|
||||||
|
+++ b/conformance-suites/2.0.0/js/js-test-pre.js
|
||||||
|
@@ -111,11 +111,25 @@ function nonKhronosFrameworkNotifyDone() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-function reportTestResultsToHarness(success, msg) {
|
||||||
|
- if (window.parent.webglTestHarness) {
|
||||||
|
- window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
+(function() {
|
||||||
|
+ var WPT_TEST_ID = 0;
|
||||||
|
+
|
||||||
|
+ // Store the current WPT test harness `test` function
|
||||||
|
+ // if found, since it's overriden by some tests.
|
||||||
|
+ var wpt_test = window.test;
|
||||||
|
+ var wpt_assert_true = window.assert_true;
|
||||||
|
+ 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);
|
||||||
|
+ } else if (wpt_test) { // WPT test harness
|
||||||
|
+ wpt_test(function () {
|
||||||
|
+ wpt_assert_true(success, msg);
|
||||||
|
+ }, "WebGL test #" + (WPT_TEST_ID++) + ": " + msg);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }())
|
||||||
|
|
||||||
|
function reportSkippedTestResultsToHarness(success, msg) {
|
||||||
|
if (window.parent.webglTestHarness) {
|
||||||
|
@@ -132,6 +146,12 @@ function notifyFinishedToHarness() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+(function() {
|
||||||
|
+ var oldNotify = notifyFinishedToHarness;
|
||||||
|
+ var t = async_test("Overall test");
|
||||||
|
+ window.notifyFinishedToHarness = t.step_func_done(oldNotify);
|
||||||
|
+}())
|
||||||
|
+
|
||||||
|
var _bufferedConsoleLogs = [];
|
||||||
|
|
||||||
|
function _bufferedLogToConsole(msg)
|
||||||
|
@@ -162,7 +182,7 @@ function _flushBufferedLogsToConsole()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-var _jsTestPreVerboseLogging = false;
|
||||||
|
+var _jsTestPreVerboseLogging = true;
|
||||||
|
|
||||||
|
function enableJSTestPreVerboseLogging()
|
||||||
|
{
|
||||||
|
@@ -175,24 +195,12 @@ function description(msg)
|
||||||
|
if (msg === undefined) {
|
||||||
|
msg = document.title;
|
||||||
|
}
|
||||||
|
- // For MSIE 6 compatibility
|
||||||
|
- var span = document.createElement("span");
|
||||||
|
- span.innerHTML = '<p>' + msg + '</p><p>On success, you will see a series of "<span class="pass">PASS</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
|
||||||
|
- var description = document.getElementById("description");
|
||||||
|
- if (description.firstChild)
|
||||||
|
- description.replaceChild(span, description.firstChild);
|
||||||
|
- else
|
||||||
|
- description.appendChild(span);
|
||||||
|
- if (_jsTestPreVerboseLogging) {
|
||||||
|
- _bufferedLogToConsole(msg);
|
||||||
|
- }
|
||||||
|
+
|
||||||
|
+ _bufferedLogToConsole("DESCRIPTION: " +msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _addSpan(contents)
|
||||||
|
{
|
||||||
|
- var span = document.createElement("span");
|
||||||
|
- document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace
|
||||||
|
- span.innerHTML = contents + '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
function debug(msg)
|
Loading…
Add table
Add a link
Reference in a new issue