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

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

Issue 41503006: Add ToT WebGL conformance tests : part 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 7 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
## -0,0 +1 ##
+LF
\ No newline at end of property
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <!--
5
6 /*
7 ** Copyright (c) 2012 The Khronos Group Inc.
8 **
9 ** Permission is hereby granted, free of charge, to any person obtaining a
10 ** copy of this software and/or associated documentation files (the
11 ** "Materials"), to deal in the Materials without restriction, including
12 ** without limitation the rights to use, copy, modify, merge, publish,
13 ** distribute, sublicense, and/or sell copies of the Materials, and to
14 ** permit persons to whom the Materials are furnished to do so, subject to
15 ** the following conditions:
16 **
17 ** The above copyright notice and this permission notice shall be included
18 ** in all copies or substantial portions of the Materials.
19 **
20 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 */
28
29 -->
30 <meta charset="utf-8">
31 <link rel="stylesheet" type="text/css" href="../unit.css" />
32 <script type="application/x-javascript" src="../unit.js"></script>
33 <script type="application/x-javascript" src="../util.js"></script>
34 <script type="application/x-javascript">
35
36 Tests.startUnit = function () {
37 var canvas = document.getElementById('gl');
38 var gl = wrapGLContext(getGLContext(canvas));
39 var tex = gl.createTexture();
40 gl.bindTexture(gl.TEXTURE_2D, tex);
41 return [gl, tex];
42 }
43
44 Tests.testTexImage2D = function(gl) {
45 var b = document.createElement('b');
46 var div = document.createElement('div');
47 var c = document.getElementById('c');
48 assertFail("bad element b",
49 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, b); });
50 assertFail("bad element div",
51 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, div); });
52 assertFail("no element",
53 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, 0); });
54 assertFail("string as data",
55 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNE D_BYTE, "foo"); });
56 assertOk("canvas as data",
57 function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGN ED_BYTE, c); });
58 assertFail("bad target",
59 function() {gl.texImage2D(gl.FLOAT, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYT E, c); });
60 }
61
62 Tests.endUnit = function(gl, tex) {
63 gl.bindTexture(gl.TEXTURE_2D, null);
64 gl.deleteTexture(tex);
65 }
66
67 </script>
68 <style>canvas{ position:absolute; }</style>
69 </head><body>
70 <canvas id="gl" width="16" height="16"></canvas>
71 <canvas id="c" width="16" height="16"></canvas>
72 </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