Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / is-object.html
blob35c4f870c1c01c9b9df67578b5dd2f262084bc23
1 <html>
2 <head>
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>
6 </head>
7 <body>
8 <div id="description"></div>
9 <div id="console"></div>
10 <canvas id="canvas">
11 <script>
12 var wtu;
13 var canvas;
14 var gl;
15 var shouldGenerateGLError;
17 var buffer;
18 var framebuffer;
19 var program;
20 var renderbuffer;
21 var shader;
22 var texture;
24 description("Tests 'is' calls against non-bound and deleted objects");
26 wtu = WebGLTestUtils;
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)");
35 debug("");
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)");
41 debug("");
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)");
47 debug("");
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)");
53 debug("");
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)");
59 debug("");
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)");
65 debug("");
66 </script>
67 </body>
68 </html>