3 <script src=
"../../../resources/js-test.js"></script>
4 <script src=
"resources/webgl-test.js"></script>
5 <script src=
"resources/webgl-test-utils.js"></script>
8 <div id=
"description"></div>
9 <div id=
"console"></div>
15 var shouldGenerateGLError
;
24 description("Tests 'is' calls against non-bound and deleted objects");
27 canvas
= document
.getElementById("canvas");
28 gl
= wtu
.create3DContext(canvas
);
29 shouldGenerateGLError
= wtu
.shouldGenerateGLError
;
31 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "buffer = gl.createBuffer()");
32 shouldBeFalse("gl.isBuffer(buffer)");
33 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
34 shouldBeTrue("gl.isBuffer(buffer)");
37 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "framebuffer = gl.createFramebuffer()");
38 shouldBeFalse("gl.isFramebuffer(framebuffer)");
39 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)");
40 shouldBeTrue("gl.isFramebuffer(framebuffer)");
43 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "renderbuffer = gl.createRenderbuffer()");
44 shouldBeFalse("gl.isRenderbuffer(renderbuffer)");
45 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer)");
46 shouldBeTrue("gl.isRenderbuffer(renderbuffer)");
49 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "texture = gl.createTexture()");
50 shouldBeFalse("gl.isTexture(texture)");
51 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "gl.bindTexture(gl.TEXTURE_2D, texture)");
52 shouldBeTrue("gl.isTexture(texture)");
55 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "program = gl.createProgram()");
56 shouldBeTrue("gl.isProgram(program)");
57 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "gl.deleteProgram(program)");
58 shouldBeFalse("gl.isProgram(program)");
61 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "shader = gl.createShader(gl.VERTEX_SHADER)");
62 shouldBeTrue("gl.isShader(shader)");
63 shouldGenerateGLError(gl
, gl
.NO_ERROR
, "gl.deleteShader(shader)");
64 shouldBeFalse("gl.isShader(shader)");