methods.html (3691B)
1 <!-- 2 Copyright (c) 2019 The Khronos Group Inc. 3 Use of this source code is governed by an MIT-style license that can be 4 found in the LICENSE.txt file. 5 --> 6 <!DOCTYPE html> 7 <html> 8 <head> 9 <meta charset="utf-8"> 10 <title>WebGL Methods Test</title> 11 <link rel="stylesheet" href="../../resources/js-test-style.css"/> 12 <script src="../../js/js-test-pre.js"></script> 13 <script src="../../js/webgl-test-utils.js"></script> 14 <script src="../../js/tests/context-methods.js"></script> 15 </head> 16 <body> 17 <div id="description"></div> 18 <div id="console"></div> 19 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas> 20 <script> 21 "use strict"; 22 description("This test ensures that the WebGL context has all the methods in the specification."); 23 24 const methods = [ 25 "getContextAttributes", 26 "activeTexture", 27 "attachShader", 28 "bindAttribLocation", 29 "bindBuffer", 30 "bindFramebuffer", 31 "bindRenderbuffer", 32 "bindTexture", 33 "blendColor", 34 "blendEquation", 35 "blendEquationSeparate", 36 "blendFunc", 37 "blendFuncSeparate", 38 "bufferData", 39 "bufferSubData", 40 "checkFramebufferStatus", 41 "clear", 42 "clearColor", 43 "clearDepth", 44 "clearStencil", 45 "colorMask", 46 "compileShader", 47 "compressedTexImage2D", 48 "compressedTexSubImage2D", 49 "copyTexImage2D", 50 "copyTexSubImage2D", 51 "createBuffer", 52 "createFramebuffer", 53 "createProgram", 54 "createRenderbuffer", 55 "createShader", 56 "createTexture", 57 "cullFace", 58 "deleteBuffer", 59 "deleteFramebuffer", 60 "deleteProgram", 61 "deleteRenderbuffer", 62 "deleteShader", 63 "deleteTexture", 64 "depthFunc", 65 "depthMask", 66 "depthRange", 67 "detachShader", 68 "disable", 69 "disableVertexAttribArray", 70 "drawArrays", 71 "drawElements", 72 "enable", 73 "enableVertexAttribArray", 74 "finish", 75 "flush", 76 "framebufferRenderbuffer", 77 "framebufferTexture2D", 78 "frontFace", 79 "generateMipmap", 80 "getActiveAttrib", 81 "getActiveUniform", 82 "getAttachedShaders", 83 "getAttribLocation", 84 "getParameter", 85 "getBufferParameter", 86 "getError", 87 "getExtension", 88 "getFramebufferAttachmentParameter", 89 "getProgramParameter", 90 "getProgramInfoLog", 91 "getRenderbufferParameter", 92 "getShaderParameter", 93 "getShaderInfoLog", 94 "getShaderPrecisionFormat", 95 "getShaderSource", 96 "getSupportedExtensions", 97 "getTexParameter", 98 "getUniform", 99 "getUniformLocation", 100 "getVertexAttrib", 101 "getVertexAttribOffset", 102 "hint", 103 "isBuffer", 104 "isContextLost", 105 "isEnabled", 106 "isFramebuffer", 107 "isProgram", 108 "isRenderbuffer", 109 "isShader", 110 "isTexture", 111 "lineWidth", 112 "linkProgram", 113 "pixelStorei", 114 "polygonOffset", 115 "readPixels", 116 "renderbufferStorage", 117 "sampleCoverage", 118 "scissor", 119 "shaderSource", 120 "stencilFunc", 121 "stencilFuncSeparate", 122 "stencilMask", 123 "stencilMaskSeparate", 124 "stencilOp", 125 "stencilOpSeparate", 126 "texImage2D", 127 "texParameterf", 128 "texParameteri", 129 "texSubImage2D", 130 "uniform1f", 131 "uniform1fv", 132 "uniform1i", 133 "uniform1iv", 134 "uniform2f", 135 "uniform2fv", 136 "uniform2i", 137 "uniform2iv", 138 "uniform3f", 139 "uniform3fv", 140 "uniform3i", 141 "uniform3iv", 142 "uniform4f", 143 "uniform4fv", 144 "uniform4i", 145 "uniform4iv", 146 "uniformMatrix2fv", 147 "uniformMatrix3fv", 148 "uniformMatrix4fv", 149 "useProgram", 150 "validateProgram", 151 "vertexAttrib1f", 152 "vertexAttrib1fv", 153 "vertexAttrib2f", 154 "vertexAttrib2fv", 155 "vertexAttrib3f", 156 "vertexAttrib3fv", 157 "vertexAttrib4f", 158 "vertexAttrib4fv", 159 "vertexAttribPointer", 160 "viewport" 161 ]; 162 163 debug(""); 164 debug("Canvas.getContext"); 165 166 const wtu = WebGLTestUtils; 167 const canvas = document.getElementById("canvas"); 168 const gl = wtu.create3DContext(canvas); 169 170 testContextMethods(gl, methods); 171 172 debug(""); 173 var successfullyParsed = true; 174 </script> 175 <script src="../../js/js-test-post.js"></script> 176 177 </body> 178 </html>