5 <title>Zero Size Canvas Test
</title>
6 <script src=
"../../../resources/js-test.js"></script>
7 <script src=
"resources/webgl-test.js"> </script>
8 <script src=
"resources/webgl-test-utils.js"> </script>
11 <div id=
"description"></div>
12 <div id=
"console"></div>
14 description("Tests that a zero size canvas does not fail.");
15 var wtu
= WebGLTestUtils
;
16 var canvas
= document
.createElement('canvas');
17 var gl
= wtu
.create3DContext(canvas
);
20 gl
.viewport(0, 0, 0, 0);
21 var program
= wtu
.setupTexturedQuad(gl
);
22 shouldBeTrue("program != null");
23 var tex
= gl
.createTexture();
24 gl
.bindTexture(gl
.TEXTURE_2D
, tex
);
25 var pixel
= new Uint8Array([0, 255, 0, 255]);
27 gl
.TEXTURE_2D
, 0, gl
.RGBA
, 1, 1, 0, gl
.RGBA
, gl
.UNSIGNED_BYTE
, pixel
);
30 glErrorShouldBe(gl
, gl
.NO_ERROR
, "Should be no errors from setup.");