blob: 7a83f7ab0308e73f9145937343dc7e907aac265a [file] [log] [blame]
"use strict";
(function() {
var numFailures = 0;
if (window.testRunner && !window.layoutTestController) {
window.layoutTestController = window.testRunner;
}
if (window.layoutTestController) {
layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
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");
iframe.innerHTML = "";
if (numFailures > 0) {
log("FAIL", "red");
} else {
log("PASS", "green");
}
if (window.layoutTestController) {
layoutTestController.notifyDone();
}
},
}
}());