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

Side by Side Diff: conformance/more/functions/texImage2DHTMLBadArgs.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 tex = gl.createTexture();
13 gl.bindTexture(gl.TEXTURE_2D, tex);
14 return [gl, tex];
15 }
16
17 Tests.testTexImage2D = function(gl) {
18 var b = document.createElement('b');
19 var div = document.createElement('div');
20 var c = document.getElementById('c');
21 assertFail("bad element b",
22 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, b); });
23 assertFail("bad element div",
24 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, div); });
25 assertFail("no element",
26 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, 0); });
27 assertFail("string as data",
28 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, "foo"); });
29 assertOk("canvas as data",
30 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGN ED_BYTE, c); });
31 assertFail("bad target",
32 function() {gl.texImage2D(gl.FLOAT, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYT E, c); });
33 }
34
35 Tests.endUnit = function(gl, tex) {
36 gl.bindTexture(gl.TEXTURE_2D, null);
37 gl.deleteTexture(tex);
38 }
39
40 </script>
41 <style>canvas{ position:absolute; }</style>
42 </head><body>
43 <canvas id="gl" width="16" height="16"></canvas>
44 <canvas id="c" width="16" height="16"></canvas>
45 </body></html>
OLDNEW
« no previous file with comments | « conformance/more/functions/texImage2DHTML.html ('k') | conformance/more/functions/texSubImage2D.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698