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

Side by Side Diff: conformance/more/functions/bufferDataBadArgs.html

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 <!DOCTYPE html>
2 <html><head>
3 <meta charset="utf-8">
4 <link rel="stylesheet" type="text/css" href="../unit.css" />
5 <script type="application/x-javascript" src="../unit.js"></script>
6 <script type="application/x-javascript" src="../util.js"></script>
7 <script type="application/x-javascript">
8
9 Tests.startUnit = function () {
10 var canvas = document.getElementById('gl');
11 var gl = wrapGLContext(canvas.getContext(GL_CONTEXT_ID));
12 var buf = gl.createBuffer();
13 var ebuf = gl.createBuffer();
14 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
15 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebuf);
16 return [gl, buf, ebuf];
17 }
18
19 Tests.testBufferData = function(gl) {
20 assertOk("zero size data",
21 function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(0), gl.STATIC _DRAW);});
22 assertFail("bad target",
23 function(){gl.bufferData(gl.TEXTURE_2D, new Float32Array([1,2,3]), gl.ST ATIC_DRAW);});
24 // assertFail("array for data",
25 // function(){gl.bufferData(gl.ARRAY_BUFFER, [1,2,3], gl.STATIC_DRAW);});
26 assertFail("bad usage",
27 function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1,2,3]), gl. TEXTURE_2D);});
28 assertOk(function(){gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Float32Array( [1,2,3]), gl.STATIC_DRAW);});
29 throwError(gl, 'bufferData');
30 gl.bindBuffer(gl.ARRAY_BUFFER, null);
31 assertFail(function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1,2,3 ]), gl.STATIC_DRAW);});
32 throwError(gl, 'bufferData');
33 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
34 assertFail(function(){gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array ([1,2,3]), gl.STATIC_DRAW);});
35 throwError(gl, 'bufferData');
36 }
37
38 Tests.endUnit = function(gl, buf, ebuf) {
39 gl.deleteBuffer(buf);
40 gl.deleteBuffer(ebuf);
41 }
42
43
44 </script>
45 <style>canvas{ position:absolute; }</style>
46 </head><body>
47 <canvas id="gl" width="16" height="16"></canvas>
48 </body></html>
OLDNEW
« no previous file with comments | « conformance/more/functions/bufferData.html ('k') | conformance/more/functions/bufferSubData.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698