1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
6 <title>WebGL gl.getParameter Strings Conformance Tests
</title>
7 <script src=
"resources/desktop-gl-constants.js" type=
"text/javascript"></script>
8 <script src=
"../../../resources/js-test.js"></script>
9 <script src=
"resources/webgl-test.js"></script>
12 <div id=
"description"></div>
13 <div id=
"console"></div>
14 <canvas id=
"canvas" width=
"2" height=
"2"> </canvas>
16 description("This test checks getParameter returns strings in the correct format");
19 debug("Canvas.getContext");
21 var gl
= create3DContext(document
.getElementById("canvas"));
23 testFailed("context does not exist");
25 testPassed("context exists");
28 checkPrefix("WebGL 1.0", "VERSION");
29 checkPrefix("WebGL GLSL ES 1.0", "SHADING_LANGUAGE_VERSION");
30 shouldBeNonNull("gl.getParameter(gl.VENDOR)");
31 shouldBeNonNull("gl.getParameter(gl.RENDERER)");
32 shouldBe("gl.getError()", "gl.NO_ERROR");
35 function checkPrefix(expected
, enum_val
) {
36 var s
= gl
.getParameter(gl
[enum_val
]);
38 s
.length
>= expected
.length
&&
39 s
.substring(0, expected
.length
) == expected
) {
40 testPassed("getParameter(gl." + enum_val
+ ") correctly started with " + expected
);
42 testFailed("getParameter(gl." + enum_val
+ ") did not start with " + expected
);