blob: e92d3734e37f2175efe35ed423e70c3c2d5fbfe3 [file] [log] [blame]
--- scripts/WebGL/webgl-conformance-tests.html 2012-02-17 13:30:20.000000000
+++ scripts/WebGL/webgl-conformance-tests.html 2012-02-17 16:25:14.000000000
@@ -342,12 +342,48 @@
if (this.currentPage != null) {
this.currentPage.finishPage(success);
this.currentPage = null;
}
};
+ // send results to autotest graphics_WebGLConformance.py
+ Reporter.prototype.postFinalResults = function(summary) {
+ var xhr = new XMLHttpRequest();
+ xhr.open('POST', 'http://localhost:8000/WebGL/results', false);
+ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState != 4) { return; }
+ }
+ msg = "";
+ var totalPages = 0;
+ var totalSuccessfulPages = 0;
+ var totalTests = 0;
+ var totalSuccessful = 0;
+ var totalTimeouts = 0;
+
+ for (var url in this.pagesByURL) {
+ var page = this.pagesByURL[url];
+ ++totalPages;
+ totalTests += page.totalTests;
+ totalSuccessful += page.totalSuccessful;
+ totalTimeouts += page.totalTimeouts;
+ pageFailures = page.totalTests - page.totalSuccessful;
+ if (pageFailures == 0)
+ ++totalSuccessfulPages;
+ else
+ msg = msg + "&" + escape("failed_url:" + url) + "=" + pageFailures;
+ }
+ // pages or group counts (coarse)
+ msg = msg + "&gtotal=" + totalPages + "&gpass=" + totalSuccessfulPages;
+ // individual test counts (fine)
+ msg = msg + "&ttotal=" + totalTests + "&tpass=" + totalSuccessful;
+ msg = msg + "&ttimeout=" + totalTimeouts;
+ // copy of the text summary to store on the file system
+ msg = msg + "&summary=" + escape(summary);
+ xhr.send(msg);
+ }
Reporter.prototype.displayFinalResults = function(msg, success) {
if (success) {
var totalTests = 0;
var totalSuccessful = 0;
var totalTimeouts = 0;
for (var url in this.pagesByURL) {
@@ -398,15 +434,19 @@
tx += "Generated on: " + (new Date()).toString() + "\n";
var r = document.getElementById("testResultsAsText");
while (r.firstChild) r.removeChild(r.firstChild);
r.appendChild(document.createTextNode(tx));
document.getElementById("showTextSummary").style.visibility = "visible";
+ // send results to autotest graphics_WebGLConformance
+ this.postFinalResults(tx);
} else {
var e = document.getElementById("error");
e.innerHTML = msg;
+ // send results to autotest graphics_WebGLConformance
+ this.postFinalResults("Error: " + msg);
}
};
Reporter.prototype.ready = function() {
var loading = document.getElementById("loading");
loading.style.display = "none";
@@ -489,12 +529,14 @@
};
if (reporter.noWebGL) {
button.disabled = true;
var elem = document.getElementById("nowebgl");
elem.style.display = "";
}
+ // Wait 3 seconds for filelist to load async. Then automatically start.
+ setTimeout(testHarness.runTests.bind(testHarness), 3000);
}
</script>
</head>
<body onload="start()">
<table border="2">
<tr style="height: 300px;">