Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / tex-image-and-uniform-binding-bugs.html
blob4ea62a2f00118f695e0f4c4fc9e53bfa4aa3f78b
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
10 <script>
12 description('Tests passing a vec4 to a uniform and a canvas to texImage2D');
14 var gl = create3DContext();
15 var floatProgram = loadProgram(gl, "resources/floatUniformShader.vert", "resources/noopUniformShader.frag");
16 shouldBeUndefined("gl.useProgram(floatProgram)");
17 var fval4Loc = gl.getUniformLocation(floatProgram, "fval4");
18 shouldBe("gl.getError()", "gl.NO_ERROR");
19 shouldBeUndefined("gl.uniform4fv(fval4Loc, new Float32Array([0.1, 0.2, 0.4, 1.0]));");
21 var tmpcanvas = document.createElement("canvas");
22 tmpcanvas.width = 2;
23 tmpcanvas.height = 2;
24 var texture = gl.createTexture();
25 shouldBeUndefined("gl.bindTexture(gl.TEXTURE_2D, texture)");
26 shouldBeUndefined("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tmpcanvas)");
28 </script>
30 </body>
31 </html>