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