/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** *Reporttheresultsinthetestsarray.
*/ "reportResults": function() { var element = function element(aLocalName) { var xhtmlNS = "http://www.w3.org/1999/xhtml"; return document.createElementNS(xhtmlNS, aLocalName);
};
var stylesheet = element("link");
stylesheet.setAttribute("rel", "stylesheet");
stylesheet.setAttribute("href", "/resources/testharness.css"); var heads = document.getElementsByTagName("head"); if (heads.length) {
heads[0].appendChild(stylesheet);
}
var log = document.getElementById("log"); if (!log) { return;
} var section = log.appendChild(element("section"));
section.id = "summary";
section.appendChild(element("h2")).textContent = "Details";
var table = section.appendChild(element("table"));
table.id = "results";
var tr = table.appendChild(element("thead")).appendChild(element("tr")); for (var header of ["Result", "Test Name", "Message"]) {
tr.appendChild(element("th")).textContent = header;
} var statuses = [
["Unexpected Fail", "Pass"],
["Known Fail", "Unexpected Pass"]
]; var tbody = table.appendChild(element("tbody")); for (var test of this.tests) {
tr = tbody.appendChild(element("tr"));
tr.className = (test.result === !test.todo ? "pass" : "fail");
tr.appendChild(element("td")).textContent =
statuses[+test.todo][+test.result];
tr.appendChild(element("td")).textContent = test.name;
tr.appendChild(element("td")).textContent = test.message;
}
},
/** *Letsthetestrunnerknowaboutatestresult.
*/ "_log": function(test) { var url = this.getURL(); var message = this.formatTestMessage(test); var result = this.prefixes[+test.todo][+test.result];
/** *Timeoutthecurrenttest.Intendedtobeusedfromharnesscode,not *fromtests.
*/ "timeout": async function() { this.logFailure("Timeout", "Test runner timed us out.");
timeout();
}
};
(function() { try { var path = W3CTest.getPath(); if (path) { // Get expected fails. If there aren't any, there will be a 404, which is // fine. Anything else is unexpected. var url = W3CTest.pathprefix + "failures/" + path + ".json"; var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(); if (request.status === 200) {
W3CTest.expectedFailures = JSON.parse(request.responseText);
} elseif (request.status !== 404) {
W3CTest.logFailure("Fetching failures file", "Request status was " + request.status);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.