| <title>Zero Size Canvas Test</title> |
| <script src="../../../resources/js-test.js"></script> |
| <script src="resources/webgl-test.js"> </script> |
| <script src="resources/webgl-test-utils.js"> </script> |
| <div id="description"></div> |
| description("Tests that a zero size canvas does not fail."); |
| var wtu = WebGLTestUtils; |
| var canvas = document.createElement('canvas'); |
| var gl = wtu.create3DContext(canvas); |
| var program = wtu.setupTexturedQuad(gl); |
| shouldBeTrue("program != null"); |
| var tex = gl.createTexture(); |
| gl.bindTexture(gl.TEXTURE_2D, tex); |
| var pixel = new Uint8Array([0, 255, 0, 255]); |
| gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel); |
| glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup."); |