blob: b766c8a8c74e734304ed10a4dfe4f93c93cd9ba0 [file] [log] [blame]
"use strict";
(function() {
var numFailures = 0;
if (window.testRunner && !window.layoutTestController) {
window.layoutTestController = window.testRunner;
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
// Turn off console messages because for the WebGL tests they are
// GPU capability dependent.
window.console.log = function() { };
window.console.error = function() { };
}
if (window.internals) {
window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
}
var log = function(msg, color) {
var div = document.createElement("div");
div.appendChild(document.createTextNode(msg));
if (color) {
div.style.color = color;
}
document.getElementById("result").appendChild(div);
};
window.webglTestHarness = {
reportResults: function(url, success, msg) {
if (!success) {
++numFailures;
}
},
notifyFinished: function(url) {
var iframe = document.getElementById("iframe");
if (numFailures > 0) {
log("FAIL", "red");
} else {
log("PASS", "green");
iframe.innerHTML = "";
}
if (window.layoutTestController) {
layoutTestController.notifyDone();
}
},
}
}());