3 <script type="text/javascript"
4 src="../../../../third_party/webgl_conformance/resources/webgl-test-harness.js">
7 // We parse the test list offline and run the harness multiple times with each
8 // test. Therefore, the version and options do not matter for the browsertests.
9 // However, we still need to pass in a valid options for the harness to run.
10 var CONFORMANCE_TEST_VERSION = "1.0.1 (beta)";
12 version: CONFORMANCE_TEST_VERSION
15 var BASE_URL = "../../../../third_party/webgl_conformance/";
20 function start(start_url) {
21 // Report function called by each conformance test.
22 function report(type, msg, success) {
23 var reportType = WebGLTestHarnessModule.TestHarness.reportType;
25 case reportType.START_PAGE:
26 // Accept every page loaded.
30 case reportType.TEST_RESULT:
33 messages.push("FAILURE: " + msg);
36 case reportType.FINISH_PAGE:
37 if (success === undefined) {
39 messages.push("TIMEOUT: " +
40 window.webglTestHarness.timeoutDelay + " ms");
42 case reportType.FINISHED_ALL_TESTS:
43 if (numFailures > 0) {
44 var ext = gl.getExtension("WEBGL_debug_renderer_info");
46 messages.push("GL_VENDOR: " +
47 gl.getParameter(ext.UNMASKED_VENDOR_WEBGL));
48 messages.push("GL_RENDERER: " +
49 gl.getParameter(ext.UNMASKED_RENDERER_WEBGL));
52 messages.push("SUCCESS");
54 domAutomationController.setAutomationId(1);
55 domAutomationController.send(messages.join("\n"));
60 function create3DContext() {
61 var canvas = document.createElement("canvas");
64 context = canvas.getContext("webgl");
69 context = canvas.getContext("experimental-webgl");
76 // Assert the WebGL context exists.
77 gl = create3DContext();
79 domAutomationController.setAutomationId(1);
80 domAutomationController.send("FAILURE: unable to fetch WebGL context");
84 var iframe = document.getElementById("testframe");
85 var testHarness = new WebGLTestHarnessModule.TestHarness(
91 window.webglTestHarness = testHarness;
92 window.webglTestHarness.runTests();
97 <iframe id="testframe" scrolling="yes" width="100%" height="100%"></iframe>