4 ** Copyright (c) 2013 The Khronos Group Inc.
6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to
11 ** permit persons to whom the Materials are furnished to do so, subject to
12 ** the following conditions:
14 ** The above copyright notice and this permission notice shall be included
15 ** in all copies or substantial portions of the Materials.
17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
30 <meta charset="utf-8">
31 <!-- Prevents Chrome from offering to translate tests which generate
32 random characters for things like attribute names -->
33 <meta name="google" value="notranslate">
34 <title>WebGL Conformance Tests</title>
42 font-family: Verdana, Arial, sans-serif;
48 text-decoration: none;
52 border-bottom: 1px solid #66D;
72 border-bottom: 1px solid #CCC;
87 border-left: 1px solid #CCC;
104 margin-bottom: 1.5em;
122 border-width: 0px 0 1px 0;
123 background-color: #FFF;
124 padding: 4px 0 4px 0;
126 -webkit-transition: background-color 0.25s;
127 -moz-transition: background-color 0.25s;
128 transition: background-color 0.25s;
131 .testpage:first-child {
132 border-width: 1px 0 1px 0;
138 .testpagesuccess { background-color: #8F8; }
139 .testpagefail { background-color: #F88; }
140 .testpageskipped { background-color: #888; }
141 .testpagetimeout { background-color: #FC8; }
142 .nowebgl { font-weight: bold; color: red; }
160 <script type="text/javascript" src="resources/webgl-test-harness.js"></script>
163 var DEFAULT_CONFORMANCE_TEST_VERSION = "1.0.3 (beta)";
166 version: DEFAULT_CONFORMANCE_TEST_VERSION,
179 if (window.console && window.console.log) {
180 window.console.log(msg);
184 function create3DContext(canvas, attrs, version) {
186 canvas = document.createElement("canvas");
192 names = ["webgl2", "experimental-webgl2"]; break;
194 names = ["webgl", "experimental-webgl"]; break;
196 for (var i = 0; i < names.length; ++i) {
198 context = canvas.getContext(names[i], attrs);
208 var reportType = WebGLTestHarnessModule.TestHarness.reportType;
211 var autoScrollEnabled = true; // Whether the user prefers to auto scroll
212 var autoScroll = true; // Whether auto scroll is actually performed
214 var Page = function(reporter, folder, testIndex, url) {
215 this.reporter = reporter;
216 this.folder = folder;
219 this.totalSuccessful = 0;
220 this.totalTimeouts = 0;
221 this.totalSkipped = 0;
222 this.testIndex = testIndex;
224 this.elementId = "page" + pageCount++;
225 var li = reporter.localDoc.createElement('li');
226 li.id = this.elementId;
227 var div = reporter.localDoc.createElement('div');
228 div.classList.add('pageHeader');
229 var check = reporter.localDoc.createElement('input');
230 check.type = 'checkbox';
231 check.checked = true;
232 div.appendChild(check);
233 var button = reporter.localDoc.createElement('input');
234 button.type = 'button';
235 button.value = 'run';
236 button.onclick = function() {
238 reporter.runTest(url);
240 if (reporter.noSelectedWebGLVersion) {
241 button.disabled = true;
243 div.appendChild(button);
244 var a = reporter.localDoc.createElement('a');
245 a.href = WebGLTestHarnessModule.getURLWithVersion(url, reporter.selectedWebGLVersion);
247 var node = reporter.localDoc.createTextNode(url);
250 li.setAttribute('class', 'testpage');
252 var ul = reporter.localDoc.createElement('ul');
253 var node = reporter.localDoc.createTextNode('');
255 div.appendChild(node);
256 this.totalsElem = node;
257 this.resultElem = ul;
262 Page.prototype.addResult = function(msg, success, skipped) {
264 if (success === undefined) {
265 ++this.totalTimeouts;
266 var result = "timeout";
268 } else if (success) {
272 ++this.totalSuccessful;
274 // don't report success.
277 var result = "failed";
281 var node = this.reporter.localDoc.createTextNode(result + ': ' + msg);
282 var li = this.reporter.localDoc.createElement('li');
283 li.appendChild(node);
284 li.setAttribute('class', css);
285 this.resultElem.appendChild(li);
288 Page.prototype.startPage = function() {
289 if (autoScroll && this.elem.scrollIntoView) {
290 this.elem.scrollIntoView(false);
293 this.totalSuccessful = 0;
294 this.totalTimeouts = 0;
295 // remove previous results.
296 while (this.resultElem.hasChildNodes()) {
297 this.resultElem.removeChild(this.resultElem.childNodes[0]);
299 this.totalsElem.textContent = '';
301 var shouldRun = this.check.checked && this.folder.checked();
304 this.elem.classList.remove('testpagetimeout');
305 this.elem.classList.remove('testpageskipped');
306 this.elem.classList.remove('testpagefail');
307 this.elem.classList.remove('testpagesuccess');
310 return this.check.checked && this.folder.checked();
313 Page.prototype.firstTestIndex = function() {
314 return this.testIndex;
317 Page.prototype.finishPage = function(success) {
318 if(this.totalSkipped) {
319 var msg = ' (' + this.totalSkipped + ' of ' + this.totalTests + ' skipped)';
321 var msg = ' (' + this.totalSuccessful + ' of ' + this.totalTests + ' passed)';
324 if (success === undefined) {
325 var css = 'testpagetimeout';
328 ++this.totalTimeouts;
329 } else if (this.totalSkipped) {
330 var css = 'testpageskipped';
331 } else if (this.totalSuccessful != this.totalTests) {
332 var css = 'testpagefail';
334 var css = 'testpagesuccess';
336 this.elem.classList.add(css);
337 this.totalsElem.textContent = msg;
340 Page.prototype.enableTest = function(re) {
341 if (this.url.match(re)) {
342 this.check.checked = true;
343 this.folder.enableUp_();
347 Page.prototype.disableTest = function(re) {
348 if (this.url.match(re)) {
349 this.check.checked = false;
353 var Folder = function(reporter, folder, depth, opt_name) {
354 this.reporter = reporter;
356 this.name = opt_name || "";
357 this.displayName = this.name;
358 if (folder && folder.displayName) {
359 this.displayName = folder.displayName + '/' + this.displayName;
361 this.subFolders = {};
364 this.folder = folder;
367 var doc = reporter.localDoc;
368 this.elementId = "folder" + folderCount++;
369 var li = doc.createElement('li');
370 li.id = this.elementId;
371 li.classList.add("folder");
372 var div = doc.createElement('div');
373 div.classList.add('folderHeader');
374 var check = doc.createElement('input');
375 check.type = 'checkbox';
376 check.checked = true;
377 div.appendChild(check);
378 var button = doc.createElement('input');
379 button.type = 'button';
380 button.value = 'run';
381 button.onclick = function() {
382 autoScroll = autoScrollEnabled;
385 if (reporter.noSelectedWebGLVersion) {
386 button.disabled = true;
388 div.appendChild(button);
389 var h = doc.createElement('span');
390 h.classList.add('folderName');
391 h.appendChild(doc.createTextNode(this.displayName));
393 var ul = doc.createElement('ul');
399 this.folderHeader = div;
402 Folder.prototype.checked = function() {
403 return this.check.checked &&
404 (this.folder ? this.folder.checked() : true);
407 Folder.prototype.firstTestIndex = function() {
408 return this.items[0].firstTestIndex();
411 Folder.prototype.numChildren = function() {
413 for (var name in this.subFolders) {
414 numChildren += this.subFolders[name].numChildren();
416 return numChildren + this.pages.length;
419 Folder.prototype.run = function() {
420 var firstTestIndex = this.firstTestIndex();
421 var count = this.numChildren();
422 log("run tests: " + firstTestIndex + " to " + (firstTestIndex + count - 1))
423 testHarness.runTests({start: firstTestIndex, count: count});
426 Folder.prototype.getSubFolder = function(name) {
427 var subFolder = this.subFolders[name];
428 if (subFolder === undefined) {
429 subFolder = new Folder(this.reporter, this, this.depth + 1, name);
430 this.subFolders[name] = subFolder;
431 this.items.push(subFolder);
432 this.childUL.appendChild(subFolder.elem);
437 Folder.prototype.getOrCreateFolder = function(url) {
438 var parts = url.split('/');
440 for (var pp = 0; pp < parts.length - 1; ++pp) {
441 folder = folder.getSubFolder(parts[pp]);
446 Folder.prototype.addPage = function(page) {
447 this.pages.push(page);
448 this.items.push(page);
449 this.childUL.appendChild(page.elem);
450 this.folderHeader.classList.add('hasPages');
453 Folder.prototype.disableTest = function(re, opt_forceRecurse) {
455 if (this.name.match(re)) {
456 this.check.checked = false;
457 recurse = opt_forceRecurse;
460 for (var name in this.subFolders) {
461 this.subFolders[name].disableTest(re, opt_forceRecurse);
463 for (var ii = 0; ii < this.pages.length; ++ii) {
464 this.pages[ii].disableTest(re);
469 Folder.prototype.enableUp_ = function() {
470 this.check.checked = true;
471 var parent = this.folder;
477 Folder.prototype.enableTest = function(re) {
478 if (this.name.match(re)) {
481 for (var name in this.subFolders) {
482 this.subFolders[name].enableTest(re);
484 for (var ii = 0; ii < this.pages.length; ++ii) {
485 this.pages[ii].enableTest(re);
489 var Reporter = function(iframes) {
490 this.localDoc = document;
491 this.resultElem = document.getElementById("results");
492 this.fullResultsElem = document.getElementById("fullresults");
493 var node = this.localDoc.createTextNode('');
494 this.fullResultsElem.appendChild(node);
495 this.fullResultsNode = node;
496 this.iframes = iframes;
497 this.currentPageElem = null;
499 this.pagesByURL = {};
501 // Check to see if WebGL is supported
502 var canvas = document.createElement("canvas");
503 var ctx = create3DContext(canvas, null, 1);
505 // Check to see if WebGL2 is supported
506 var canvas2 = document.createElement("canvas");
507 var ctx2 = create3DContext(canvas2, null, 2);
509 this.noSelectedWebGLVersion = false;
510 this.selectedWebGLVersion = WebGLTestHarnessModule.getMajorVersion(OPTIONS.version);
511 if (this.selectedWebGLVersion == 2 && !ctx2) {
512 this.noSelectedWebGLVersion = true;
513 } else if (this.selectedWebGLVersion == 1 && !ctx) {
514 this.noSelectedWebGLVersion = true;
517 // If the WebGL2 context could be created use it to get context info
524 this.contextInfo = {};
525 this.root = new Folder(this, null, 0, "all");
526 this.resultElem.appendChild(this.root.elem);
527 this.callbacks = { };
530 this.contextInfo["VENDOR"] = ctx.getParameter(ctx.VENDOR);
531 this.contextInfo["VERSION"] = ctx.getParameter(ctx.VERSION);
532 this.contextInfo["RENDERER"] = ctx.getParameter(ctx.RENDERER);
533 this.contextInfo["RED_BITS"] = ctx.getParameter(ctx.RED_BITS);
534 this.contextInfo["GREEN_BITS"] = ctx.getParameter(ctx.GREEN_BITS);
535 this.contextInfo["BLUE_BITS"] = ctx.getParameter(ctx.BLUE_BITS);
536 this.contextInfo["ALPHA_BITS"] = ctx.getParameter(ctx.ALPHA_BITS);
537 this.contextInfo["DEPTH_BITS"] = ctx.getParameter(ctx.DEPTH_BITS);
538 this.contextInfo["STENCIL_BITS"] = ctx.getParameter(ctx.STENCIL_BITS);
540 var ext = ctx.getExtension("WEBGL_debug_renderer_info");
542 this.contextInfo["UNMASKED_VENDOR"] = ctx.getParameter(ext.UNMASKED_VENDOR_WEBGL);
543 this.contextInfo["UNMASKED_RENDERER"] = ctx.getParameter(ext.UNMASKED_RENDERER_WEBGL);
548 Reporter.prototype.enableTest = function(name) {
549 this.root.enableTest(name);
552 Reporter.prototype.disableTest = function(name) {
553 this.root.disableTest(name);
556 Reporter.prototype.disableAllTests = function() {
557 this.root.disableTest(".*", true);
560 Reporter.prototype.addEventListener = function(type, func) {
561 if (!this.callbacks[type]) {
562 this.callbacks[type] = [];
564 this.callbacks[type].push(func);
567 Reporter.prototype.executeListenerEvents_ = function(type) {
568 var callbacks = this.callbacks[type].slice(0);
569 for (var ii = 0; ii < callbacks.length; ++ii) {
570 setTimeout(callbacks[ii], 0);
574 Reporter.prototype.runTest = function(url) {
575 var page = this.pagesByURL[url];
576 testHarness.runTests({start: page.firstTestIndex(), count: 1});
579 Reporter.prototype.getFolder = function(url) {
580 return this.root.getOrCreateFolder(url);
583 Reporter.prototype.addPage = function(url) {
584 var folder = this.getFolder(url);
585 var page = new Page(this, folder, this.totalPages, url);
586 folder.addPage(page);
588 this.pagesByURL[url] = page;
591 Reporter.prototype.startPage = function(url) {
592 var page = this.pagesByURL[url];
593 return page.startPage();
596 Reporter.prototype.addResult = function(url, msg, success, skipped) {
597 var page = this.pagesByURL[url];
598 page.addResult(msg, success, skipped);
601 Reporter.prototype.finishPage = function(url, success) {
602 var page = this.pagesByURL[url];
603 page.finishPage(success);
606 Reporter.prototype.displayFinalResults = function(msg, success) {
609 var totalSuccessful = 0;
610 var totalTimeouts = 0;
611 var totalSkipped = 0;
612 for (var url in this.pagesByURL) {
613 var page = this.pagesByURL[url];
614 totalTests += page.totalTests;
615 totalSuccessful += page.totalSuccessful;
616 totalTimeouts += page.totalTimeouts;
617 totalSkipped += page.totalSkipped;
620 if (totalTimeouts > 0) {
621 timeout = ', ' + totalTimeouts + ' timed out';
623 var msg = ' (' + totalSuccessful + ' of ' +
624 totalTests + ' passed' + timeout + ')';
625 this.fullResultsNode.textContent = msg;
627 // generate a text summary
629 tx += "WebGL Conformance Test Results\n";
630 tx += "Version " + OPTIONS.version + "\n";
632 tx += "-------------------\n\n";
633 tx += "User Agent: " + (navigator.userAgent ? navigator.userAgent : "(navigator.userAgent is null)") + "\n";
634 tx += "WebGL VENDOR: " + this.contextInfo["VENDOR"] + "\n";
635 tx += "WebGL VERSION: " + this.contextInfo["VERSION"] + "\n";
636 tx += "WebGL RENDERER: " + this.contextInfo["RENDERER"] + "\n";
637 tx += "Unmasked VENDOR: " + this.contextInfo["UNMASKED_VENDOR"] + "\n";
638 tx += "Unmasked RENDERER: " + this.contextInfo["UNMASKED_RENDERER"] + "\n";
639 tx += "WebGL R/G/B/A/Depth/Stencil bits (default config): " + this.contextInfo["RED_BITS"] + "/" + this.contextInfo["GREEN_BITS"] + "/" + this.contextInfo["BLUE_BITS"] + "/" + this.contextInfo["ALPHA_BITS"] + "/" + this.contextInfo["DEPTH_BITS"] + "/" + this.contextInfo["STENCIL_BITS"] + "\n";
641 tx += "-------------------\n\n";
642 tx += "Test Summary (" + totalTests + " total tests):\n";
643 tx += "Tests PASSED: " + totalSuccessful + "\n";
644 tx += "Tests FAILED: " + (totalTests - totalSuccessful - totalSkipped) + "\n";
645 tx += "Tests TIMED OUT: " + totalTimeouts + "\n";
646 tx += "Tests SKIPPED: " + totalSkipped + "\n";
648 tx += "-------------------\n\n";
649 if (totalSuccessful < totalTests) {
650 tx += "Failures:\n\n";
651 for (var url in this.pagesByURL) {
652 var page = this.pagesByURL[url];
653 var pageTotalFail = page.totalTests - page.totalSuccessful - page.totalSkipped;
654 if (!(page.totalTests == 0 && page.totalTimeouts == 0) &&
657 tx += url + ": " + pageTotalFail + " tests failed";
658 if (page.totalTimeouts)
659 tx += " (" + page.totalTimeouts + " timed out)";
664 tx += "All tests PASSED\n\n";
667 tx += "-------------------\n\n";
668 tx += "Complete Test Results (total / pass / fail / timeout / skipped):\n\n";
669 for (var url in this.pagesByURL) {
670 var page = this.pagesByURL[url];
671 var pageTotalFail = page.totalTests - page.totalSuccessful - page.totalSkipped;
672 if (!(page.totalTests == 0 && page.totalTimeouts == 0)) {
673 tx += url + ": " + page.totalTests + " / " +
674 page.totalSuccessful + " / " + pageTotalFail + " / " + page.totalTimeouts + " / " + page.totalSkipped + "\n";
678 tx += "-------------------\n\n";
679 tx += "Generated on: " + (new Date()).toString() + "\n";
681 var r = document.getElementById("testResultsAsText");
682 while (r.firstChild) r.removeChild(r.firstChild);
683 r.appendChild(document.createTextNode(tx));
684 document.getElementById("showTextSummary").style.visibility = "visible";
686 this.postResultsToServer(tx);
688 var e = document.getElementById("error");
690 this.postResultsToServer(msg);
694 Reporter.prototype.postTestStartToServer = function(resultText) {
695 if(OPTIONS.postResults == undefined || OPTIONS.postResults == 0) {
699 var xhr = new XMLHttpRequest();
700 xhr.open('POST', "/start", true);
704 Reporter.prototype.postResultsToServer = function(resultText) {
705 if(OPTIONS.postResults == undefined || OPTIONS.postResults == 0) {
709 var xhr = new XMLHttpRequest();
710 xhr.open('POST', "/finish", true);
711 xhr.setRequestHeader("Content-Type", "text/plain");
712 xhr.send(resultText);
715 Reporter.prototype.ready = function() {
716 var loading = document.getElementById("loading");
717 loading.style.display = "none";
718 if (!this.noSelectedWebGLVersion) {
719 var button = document.getElementById("runTestsButton");
720 button.disabled = false;
721 this.executeListenerEvents_("ready");
725 Reporter.prototype.reportFunc = function(type, url, msg, success, skipped) {
727 case reportType.ADD_PAGE:
728 return this.addPage(msg);
729 case reportType.READY:
731 case reportType.START_PAGE:
732 return this.startPage(url);
733 case reportType.TEST_RESULT:
734 return this.addResult(url, msg, success, skipped);
735 case reportType.FINISH_PAGE:
736 return this.finishPage(url, success);
737 case reportType.FINISHED_ALL_TESTS:
738 return this.displayFinalResults(msg, success);
745 var getURLOptions = function(obj) {
746 var s = window.location.href;
747 var q = s.indexOf("?");
748 var e = s.indexOf("#");
752 var query = s.substring(q + 1, e);
753 var pairs = query.split("&");
754 for (var ii = 0; ii < pairs.length; ++ii) {
755 var keyValue = pairs[ii].split("=");
756 var key = keyValue[0];
757 var value = decodeURIComponent(keyValue[1]);
762 getURLOptions(OPTIONS);
764 var makeVersionSelect = function(currentVersion) {
765 var versionSelect = document.getElementById("testVersion");
766 var foundCurrentVersion = false;
767 var numericCurrentVersion = currentVersion.replace(/[^\d.]/g, '');
769 for (var i in testVersions) {
770 var version = testVersions[i];
771 var numericVersion = version.replace(/[^\d.]/g, '');
772 var option = document.createElement("option");
773 option.setAttribute('value', numericVersion);
774 option.innerHTML = version;
776 if (numericVersion == numericCurrentVersion) {
777 foundCurrentVersion = true;
778 option.selected = true;
781 versionSelect.appendChild(option);
784 // If the version requested by the query string isn't in the list add it.
785 if (!foundCurrentVersion) {
786 var option = document.createElement("option");
787 option.setAttribute('value', numericCurrentVersion);
788 option.innerHTML = currentVersion + " (unknown)";
789 option.selected = true;
791 versionSelect.appendChild(option);
794 versionSelect.addEventListener('change', function(ev) {
795 window.location.href = "?version=" + versionSelect.value;
799 makeVersionSelect(OPTIONS.version);
802 var makeIFrames = function() {
803 var toparea = document.getElementById("toparea");
804 var frame = document.getElementById("frames");
805 var areaWidth = Math.max(100, toparea.clientWidth - 300);
806 var areaHeight = Math.max(100, frame.clientHeight);
808 var numCells = OPTIONS.frames;
810 var gridWidth = Math.max(1, Math.ceil(Math.sqrt(numCells)));
811 var gridHeight = gridWidth;
812 var bestAspect = 99999;
813 var bestNumEmptyCells = 99999;
814 var bestNumEmptyCellsColumns = 0;
815 var bestNumEmptyCellsAspect = 99999;
816 var minGoodAspect = 1 / 3;
817 var maxGoodAspect = 3 / 1;
819 for (var columns = 1; columns <= numCells; ++columns) {
820 var rows = Math.ceil(numCells / columns);
821 var cellWidth = areaWidth / columns;
822 var cellHeight = areaHeight / rows;
823 var cellAspect = cellWidth / cellHeight;
824 if (cellAspect >= minGoodAspect && cellAspect <= maxGoodAspect) {
825 var numEmptyCells = columns * rows - numCells;
826 // Keep the one with the least number of empty cells.
827 if (numEmptyCells < bestNumEmptyCells) {
828 bestNumEmptyCells = numEmptyCells;
829 bestNumEmptyCellsColumns = columns;
830 bestNumEmptyCellsAspect = cellAspect;
831 // If it's the same number of empty cells keep the one
832 // with the best aspect.
833 } else if (numEmptyCells == bestNumEmptyCells &&
834 Math.abs(cellAspect - 1) <
835 Math.abs(bestNumEmptyCellsAspect - 1)) {
836 bestNumEmptyCellsColumns = columns;
837 bestNumEmptyCellsAspect = cellAspect;
840 if (Math.abs(cellAspect - 1) < Math.abs(bestAspect - 1)) {
843 bestAspect = cellAspect;
847 // if we found an aspect with few empty cells use that.
848 var numEmptyCells = gridWidth * gridHeight - numCells;
849 if (bestNumEmptyCellsColumns && bestNumEmptyCells < numEmptyCells) {
850 gridWidth = bestNumEmptyCellsColumns;
851 gridHeight = Math.ceil(numCells / gridWidth);
854 var table = document.createElement("table");
855 table.style.height = areaHeight + "px";
856 var tbody = document.createElement("tbody");
858 for (var row = 0; row < gridHeight; ++row) {
859 var tr = document.createElement("tr");
860 for (var column = 0; column < gridWidth; ++column) {
861 var td = document.createElement("td");
864 var iframe = document.createElement("iframe");
865 iframe.setAttribute("scrolling", "yes");
866 iframe.style.width = "100%";
867 iframe.style.height = "100%";
868 iframes.push(iframe);
869 td.appendChild(iframe);
873 tbody.appendChild(tr);
875 table.appendChild(tbody);
876 frame.appendChild(table);
879 var iframes = makeIFrames();
881 var reporter = new Reporter(iframes);
882 var testHarness = new WebGLTestHarnessModule.TestHarness(
885 function(type, url, msg, success, skipped) {
886 return reporter.reportFunc(type, url, msg, success, skipped);
889 reporter.addEventListener("ready", function() {
890 // Set which tests to include.
891 if (OPTIONS.include) {
892 reporter.disableAllTests();
893 var includes = OPTIONS.include.split(",")
894 for (var ii = 0; ii < includes.length; ++ii) {
895 reporter.enableTest(new RegExp(includes[ii]));
898 // Remove tests based on skip=re1,re2 in URL.
900 var skips = OPTIONS.skip.split(",")
901 for (var ii = 0; ii < skips.length; ++ii) {
902 reporter.disableTest(new RegExp(skips[ii]));
905 // Auto run the tests if the run=1 in URL
906 if (OPTIONS.run != undefined && OPTIONS.run != 0) {
907 reporter.postTestStartToServer();
908 testHarness.runTests();
911 window.webglTestHarness = testHarness;
912 var button = document.getElementById("runTestsButton");
913 button.disabled = true;
914 button.onclick = function() {
915 autoScroll = autoScrollEnabled;
916 reporter.postTestStartToServer();
917 testHarness.runTests();
919 var autoScrollCheckbox = document.getElementById("autoScrollCheckbox");
920 autoScrollCheckbox.checked = autoScrollEnabled;
921 autoScrollCheckbox.onclick = function() {
922 autoScrollEnabled = autoScrollCheckbox.checked;
923 autoScroll = autoScrollEnabled;
925 var textbutton = document.getElementById("showTextSummary");
926 textbutton.onclick = function() {
928 var htmldiv = document.getElementById("testResultsHTML");
929 var textdiv = document.getElementById("testResultsText");
930 if (textdiv.style.display == "none") {
931 textdiv.style.display = "block";
932 htmldiv.style.display = "none";
933 textbutton.setAttribute("value", "display html summary");
935 textdiv.style.display = "none";
936 htmldiv.style.display = "block";
937 textbutton.setAttribute("value", "display text summary");
940 if (reporter.noSelectedWebGLVersion) {
941 button.disabled = true;
943 if (reporter.noWebGL) {
944 var elem = document.getElementById("nowebgl");
945 elem.style.display = "";
946 reporter.postResultsToServer("Browser does not appear to support WebGL");
947 } else if (reporter.noSelectedWebGLVersion) {
948 var elem = document.getElementById("noselectedwebgl");
949 elem.style.display = "";
950 reporter.postResultsToServer("Browser does not appear to support the selected version of WebGL");
955 <body onload="start()">
959 <div id="testResultsHTML">
963 <div style="display: none;" id="testResultsText">
964 <pre id="testResultsAsText"></pre>
967 </div> <!-- end of container -->
972 <tr style="height: 300px;">
976 <td style="width: 300px">
978 <img src="resources/webgl-logo.png" /><br />
979 WebGL Conformance Test Runner<br/>
981 <select id="testVersion">
984 <a href="../../conformance-suites/"><i>(click here for previous versions)</i></a>
986 <input type="button" value="run tests" id="runTestsButton"/>
988 <input type="checkbox" id="autoScrollCheckbox"/>
989 <label for="autoScrollCheckbox">auto scroll</label>
991 <input type="button" style="visibility: hidden;" value="display text summary" id="showTextSummary"/>
992 <div id="nowebgl" class="nowebgl" style="display: none;">
993 This browser does not appear to support WebGL
995 <div id="noselectedwebgl" class="nowebgl" style="display: none;">
996 This browser does not appear to support the selected version of WebGL
1008 <span id="fullresults">
1015 <div id="error-wrap">
1016 <pre id="error"></pre>
1022 <td id="frames"></td>
1025 </div> <!-- end of header -->