1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <meta content='text/html; charset=UTF-
8' http-equiv='Content-Type'
/>
6 <title>WebGL getShaderSource conformance test.
</title>
7 <script src=
"../../../resources/js-test.js"></script>
8 <script src=
"resources/webgl-test.js"> </script>
9 <script src=
"resources/webgl-test-utils.js"> </script>
12 <canvas id=
"example" width=
"4" height=
"4" style=
"width: 40px; height: 30px;"></canvas>
13 <div id=
"description"></div>
14 <div id=
"console"></div>
15 <script id=
"vshader" type=
"x-shader/x-vertex">abc//defNOTASCII
</script>
17 description("Tests that the source that goes into a shader is what comes out.");
18 var wtu
= WebGLTestUtils
;
19 var canvas
= document
.getElementById("example");
20 var gl
= wtu
.create3DContext(canvas
);
21 var original
= document
.getElementById("vshader").text
;
22 var shader
= gl
.createShader(gl
.VERTEX_SHADER
);
23 gl
.shaderSource(shader
, original
);
24 var source
= gl
.getShaderSource(shader
);
25 shouldBe("source", "original");
26 glErrorShouldBe(gl
, gl
.NO_ERROR
, "Should be no errors.");