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

Side by Side Diff: conformance/more/conformance/argGenerators-G_I.js

Issue 8342021: Add webgl conformance tests r15841. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 years, 2 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // ArgGenerators contains argument generators for WebGL functions.
2 // The argument generators are used for running random tests against the WebGL
3 // functions.
4 //
5 // ArgGenerators is an object consisting of functionName : argGen -properties.
6 //
7 // functionName is a WebGL context function name and the argGen is an argument
8 // generator object that encapsulates the requirements to run
9 // randomly generated tests on the WebGL function.
10 //
11 // An argGen object has the following methods:
12 // - setup -- set up state for testing the GL function, returns values
13 // that need cleanup in teardown. Run once before entering a
14 // test loop.
15 // - teardown -- do cleanup on setup's return values after testing is complete
16 // - generate -- generate a valid set of random arguments for the GL function
17 // - returnValueCleanup -- do cleanup on value returned by the tested GL funct ion
18 // - cleanup -- do cleanup on generated arguments from generate
19 // - checkArgValidity -- check if passed args are valid. Has a call signature
20 // that matches generate's return value. Returns true
21 // if args are valid, false if not.
22 //
23 // Example test loop that demonstrates how the function args and return
24 // values flow together:
25 //
26 // var setupArgs = argGen.setup();
27 // for (var i=0; i<numberOfTests; i++) {
28 // var generatedArgs = argGen.generate.apply(argGen, setupArgs);
29 // var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
30 // var rv = call the GL function with generatedArgs;
31 // argGen.returnValueCleanup(rv);
32 // argGen.cleanup.apply(argGen, generatedArgs);
33 // }
34 // argGen.teardown.apply(argGen, setupArgs);
35 //
36 ArgGenerators = {
37
38 // GL functions in alphabetical order
39
40 // G-2
41
42 getAttribLocation : {
43 generate : function() {
44 var program = GL.createProgram();
45 var name = randomName();
46 GL.bindAttribLocation(program, randomVertexAttribute(), name);
47 return [program, name];
48 },
49 checkArgValidity : function(program, name) {
50 return GL.isProgram(program) && isValidName(name);
51 },
52 cleanup : function(program, name) {
53 try { GL.deleteProgram(program); } catch(e) {}
54 }
55 },/*
56 getParameter : {
57 generate : function() { return [getParameterPname.random()]; },
58 checkArgValidity : function(p) { return getParameterPname.has(p); }
59 },
60 getBufferParameter : {}, // FIXME
61 getError : {
62 generate : function() { return []; }
63 },
64 getFramebufferAttachmentParameter : {}, // FIXME
65 getProgramParameter : {}, // FIXME
66 getProgramInfoLog : {}, // FIXME
67 getRenderbufferParameter : {}, // FIXME
68 getShaderParameter : {}, // FIXME
69 getShaderInfoLog : {}, // FIXME
70 getShaderSource : {}, // FIXME
71 getTexParameter : {}, // FIXME
72 getUniform : {}, // FIXME
73 getUniformLocation : {}, // FIXME
74 getVertexAttrib : {}, // FIXME
75 getVertexAttribOffset : {}, // FIXME
76
77 // H
78
79 hint : {
80 generate : function() { return [GL.GENERATE_MIPMAP_HINT, mipmapHint.random() ]; },
81 checkValidArgs : function(h, m) {
82 return h == GL.GENERATE_MIPMAP_HINT && mipmapHint.has(m);
83 },
84 teardown : function(){ GL.hint(GL.GENERATE_MIPMAP_HINT, GL.DONT_CARE); }
85 },
86
87 // I
88
89 isBuffer : {
90 generate : function() { return [GL.createBuffer()]; },
91 cleanup : function(o) { try { GL.deleteBuffer(o); } catch(e) {} }
92 },
93 isEnabled : {
94 generate : function() { return [enableCap.random()]; },
95 checkArgValidity : function(c) { return enableCap.has(c); }
96 },
97 isFramebuffer : {
98 generate : function() { return [GL.createFramebuffer()]; },
99 cleanup : function(o) { try { GL.deleteFramebuffer(o); } catch(e) {} }
100 },
101 isProgram : {
102 generate : function() { return [GL.createProgram()]; },
103 cleanup : function(o) { try { GL.deleteProgram(o); } catch(e) {} }
104 },
105 isRenderbuffer : {
106 generate : function() { return [GL.createRenderbuffer()]; },
107 cleanup : function(o) { try { GL.deleteRenderbuffer(o); } catch(e) {} }
108 },
109 isShader : {
110 generate : function() { return [GL.createShader(shaderType.random())]; },
111 cleanup : function(o) { try { GL.deleteShader(o); } catch(e) {} }
112 },
113 isTexture : {
114 generate : function() { return [GL.createTexture()]; },
115 cleanup : function(o) { try { GL.deleteTexture(o); } catch(e) {} }
116 }*/
117
118 };
OLDNEW
« no previous file with comments | « conformance/more/conformance/argGenerators-D_G.js ('k') | conformance/more/conformance/argGenerators-L_S.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698