Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: LayoutTests/webgl/resources/webgl_test_files/conformance/context/methods.html

Issue 14366040: Fixed spec compliance issues in WebGLRenderingContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased and retested. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!-- 1 <!--
2 2
3 /* 3 /*
4 ** Copyright (c) 2012 The Khronos Group Inc. 4 ** Copyright (c) 2012 The Khronos Group Inc.
5 ** 5 **
6 ** Permission is hereby granted, free of charge, to any person obtaining a 6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the 7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including 8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish, 9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to 10 ** distribute, sublicense, and/or sell copies of the Materials, and to
(...skipping 26 matching lines...) Expand all
37 </head> 37 </head>
38 <body> 38 <body>
39 <div id="description"></div> 39 <div id="description"></div>
40 <div id="console"></div> 40 <div id="console"></div>
41 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas> 41 <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
42 <script> 42 <script>
43 "use strict"; 43 "use strict";
44 description("This test ensures that the WebGL context has all the methods in the specification."); 44 description("This test ensures that the WebGL context has all the methods in the specification.");
45 45
46 var methods = [ 46 var methods = [
47 "canvas",
48 "getContextAttributes", 47 "getContextAttributes",
49 "activeTexture", 48 "activeTexture",
50 "attachShader", 49 "attachShader",
51 "bindAttribLocation", 50 "bindAttribLocation",
52 "bindBuffer", 51 "bindBuffer",
53 "bindFramebuffer", 52 "bindFramebuffer",
54 "bindRenderbuffer", 53 "bindRenderbuffer",
55 "bindTexture", 54 "bindTexture",
56 "blendColor", 55 "blendColor",
57 "blendEquation", 56 "blendEquation",
58 "blendEquationSeparate", 57 "blendEquationSeparate",
59 "blendFunc", 58 "blendFunc",
60 "blendFuncSeparate", 59 "blendFuncSeparate",
61 "bufferData", 60 "bufferData",
62 "bufferSubData", 61 "bufferSubData",
63 "checkFramebufferStatus", 62 "checkFramebufferStatus",
64 "clear", 63 "clear",
65 "clearColor", 64 "clearColor",
66 "clearDepth", 65 "clearDepth",
67 "clearStencil", 66 "clearStencil",
68 "colorMask", 67 "colorMask",
69 "compileShader", 68 "compileShader",
69 "compressedTexImage2D",
70 "compressedTexSubImage2D",
70 "copyTexImage2D", 71 "copyTexImage2D",
71 "copyTexSubImage2D", 72 "copyTexSubImage2D",
72 "createBuffer", 73 "createBuffer",
73 "createFramebuffer", 74 "createFramebuffer",
74 "createProgram", 75 "createProgram",
75 "createRenderbuffer", 76 "createRenderbuffer",
76 "createShader", 77 "createShader",
77 "createTexture", 78 "createTexture",
78 "cullFace", 79 "cullFace",
79 "deleteBuffer", 80 "deleteBuffer",
(...skipping 18 matching lines...) Expand all
98 "framebufferTexture2D", 99 "framebufferTexture2D",
99 "frontFace", 100 "frontFace",
100 "generateMipmap", 101 "generateMipmap",
101 "getActiveAttrib", 102 "getActiveAttrib",
102 "getActiveUniform", 103 "getActiveUniform",
103 "getAttachedShaders", 104 "getAttachedShaders",
104 "getAttribLocation", 105 "getAttribLocation",
105 "getParameter", 106 "getParameter",
106 "getBufferParameter", 107 "getBufferParameter",
107 "getError", 108 "getError",
109 "getExtension",
108 "getFramebufferAttachmentParameter", 110 "getFramebufferAttachmentParameter",
109 "getProgramParameter", 111 "getProgramParameter",
110 "getProgramInfoLog", 112 "getProgramInfoLog",
111 "getRenderbufferParameter", 113 "getRenderbufferParameter",
112 "getShaderParameter", 114 "getShaderParameter",
113 "getShaderInfoLog", 115 "getShaderInfoLog",
116 "getShaderPrecisionFormat",
114 "getShaderSource", 117 "getShaderSource",
118 "getSupportedExtensions",
115 "getTexParameter", 119 "getTexParameter",
116 "getUniform", 120 "getUniform",
117 "getUniformLocation", 121 "getUniformLocation",
118 "getVertexAttrib", 122 "getVertexAttrib",
119 "getVertexAttribOffset", 123 "getVertexAttribOffset",
120 "hint", 124 "hint",
121 "isBuffer", 125 "isBuffer",
126 "isContextLost",
122 "isEnabled", 127 "isEnabled",
123 "isFramebuffer", 128 "isFramebuffer",
124 "isProgram", 129 "isProgram",
125 "isRenderbuffer", 130 "isRenderbuffer",
126 "isShader", 131 "isShader",
127 "isTexture", 132 "isTexture",
128 "lineWidth", 133 "lineWidth",
129 "linkProgram", 134 "linkProgram",
130 "pixelStorei", 135 "pixelStorei",
131 "polygonOffset", 136 "polygonOffset",
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 "vertexAttrib1f", 173 "vertexAttrib1f",
169 "vertexAttrib1fv", 174 "vertexAttrib1fv",
170 "vertexAttrib2f", 175 "vertexAttrib2f",
171 "vertexAttrib2fv", 176 "vertexAttrib2fv",
172 "vertexAttrib3f", 177 "vertexAttrib3f",
173 "vertexAttrib3fv", 178 "vertexAttrib3fv",
174 "vertexAttrib4f", 179 "vertexAttrib4f",
175 "vertexAttrib4fv", 180 "vertexAttrib4fv",
176 "vertexAttribPointer", 181 "vertexAttribPointer",
177 "viewport" 182 "viewport"
178 ] 183 ];
179 184
180 function assertProperty(v, p) { 185 // Properties to be ignored because they were added in versions of the
186 // spec that are backward-compatible with this version
187 var ignoredMethods = [
188 ];
189
190 function assertFunction(v, f) {
181 try { 191 try {
182 if (v[p] == null) { 192 if (typeof v[f] != "function") {
183 testFailed("Property does not exist: " + p) 193 testFailed("Property either does not exist or is not a function: " + f);
184 return false; 194 return false;
185 } else { 195 } else {
186 return true; 196 return true;
187 } 197 }
188 } catch(e) { 198 } catch(e) {
189 testFailed("Trying to access the property '"+p+"' threw an error: "+e.toStri ng()); 199 testFailed("Trying to access the property '" + f + "' threw an error: "+e.to String());
190 } 200 }
191 } 201 }
192 202
193 debug(""); 203 debug("");
194 debug("Canvas.getContext"); 204 debug("Canvas.getContext");
195 205
196 var wtu = WebGLTestUtils; 206 var wtu = WebGLTestUtils;
197 var canvas = document.getElementById("canvas"); 207 var canvas = document.getElementById("canvas");
198 var gl = wtu.create3DContext(canvas); 208 var gl = wtu.create3DContext(canvas);
199 var passed = true; 209 var passed = true;
200 for (var i=0; i<methods.length; i++) { 210 for (var i=0; i<methods.length; i++) {
201 var r = assertProperty(gl, methods[i]); 211 var r = assertFunction(gl, methods[i]);
202 passed = passed && r; 212 passed = passed && r;
203 } 213 }
204 if (passed) { 214 if (passed) {
205 testPassed("All WebGL methods found."); 215 testPassed("All WebGL methods found.");
206 } 216 }
207 var extended = false; 217 var extended = false;
208 for (var i in gl) { 218 for (var i in gl) {
209 if (i.match(/^[a-z]/) && methods.indexOf(i) == -1) { 219 if (typeof gl[i] == "function" && methods.indexOf(i) == -1 && ignoredMethods.i ndexOf(i) == -1) {
210 if (!extended) { 220 if (!extended) {
211 extended = true; 221 extended = true;
212 debug("Also found the following extra methods:"); 222 testFailed("Also found the following extra methods:");
213 } 223 }
214 debug(i); 224 testFailed(i);
215 } 225 }
216 } 226 }
217 227
228 if (!extended) {
229 testPassed("No extra methods found on WebGL context.");
230 }
231
218 debug(""); 232 debug("");
219 var successfullyParsed = true; 233 var successfullyParsed = true;
220 </script> 234 </script>
221 <script src="../../resources/js-test-post.js"></script> 235 <script src="../../resources/js-test-post.js"></script>
222 236
223 </body> 237 </body>
224 </html> 238 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698