Move Khronos WebGL tests to /_webgl/

This commit is contained in:
Anthony Ramine 2018-08-25 00:46:42 +02:00
parent d827370804
commit 4852f7d616
7200 changed files with 53650 additions and 228616 deletions

View file

@ -0,0 +1,98 @@
diff --git a/conformance-suites/1.0.3/resources/js-test-pre.js b/conformance-suites/1.0.3/resources/js-test-pre.js
index 2a03001..c4bb653 100644
--- a/conformance-suites/1.0.3/resources/js-test-pre.js
+++ b/conformance-suites/1.0.3/resources/js-test-pre.js
@@ -71,11 +71,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 notifyFinishedToHarness() {
if (window.parent.webglTestHarness) {
@@ -86,13 +100,19 @@ function notifyFinishedToHarness() {
}
}
+(function() {
+ var oldNotify = notifyFinishedToHarness;
+ var t = async_test("Overall test");
+ window.notifyFinishedToHarness = t.step_func_done(oldNotify);
+}())
+
function _logToConsole(msg)
{
if (window.console)
window.console.log(msg);
}
-var _jsTestPreVerboseLogging = false;
+var _jsTestPreVerboseLogging = true;
function enableJSTestPreVerboseLogging()
{
@@ -105,31 +125,18 @@ 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) {
- _logToConsole(msg);
- }
+ _logToConsole("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)
{
_addSpan(msg);
if (_jsTestPreVerboseLogging) {
- _logToConsole(msg);
+ _logToConsole(msg);
}
}
@@ -143,7 +150,7 @@ function testPassed(msg)
reportTestResultsToHarness(true, msg);
_addSpan('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
if (_jsTestPreVerboseLogging) {
- _logToConsole('PASS ' + msg);
+ _logToConsole('PASS ' + msg);
}
}