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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/misc/null-object-behaviour.html

Issue 10399113: Roll webgl conformance tests to r17874: part 2, adding r17874 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 8 years, 7 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 <!--
2
3 /*
4 ** Copyright (c) 2012 The Khronos Group Inc.
5 **
6 ** Permission is hereby granted, free of charge, to any person obtaining a
7 ** copy of this software and/or associated documentation files (the
8 ** "Materials"), to deal in the Materials without restriction, including
9 ** without limitation the rights to use, copy, modify, merge, publish,
10 ** distribute, sublicense, and/or sell copies of the Materials, and to
11 ** permit persons to whom the Materials are furnished to do so, subject to
12 ** the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included
15 ** in all copies or substantial portions of the Materials.
16 **
17 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
24 */
25
26 -->
27
28 <!DOCTYPE html>
29 <html>
30 <head>
31 <meta charset="utf-8">
32 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
33 <script src="../../resources/js-test-pre.js"></script>
34 <script src="../resources/webgl-test.js"></script>
35 <script src="../resources/webgl-test-utils.js"></script>
36 </head>
37 <body>
38 <div id="description"></div>
39 <div id="console"></div>
40
41 <script>
42 var wtu = WebGLTestUtils;
43 description("Tests calling WebGL APIs without providing the necessary objects");
44
45 var context = wtu.create3DContext();
46 var program = wtu.loadStandardProgram(context);
47 var shader = wtu.loadStandardVertexShader(context);
48 var shouldGenerateGLError = wtu.shouldGenerateGLError;
49
50 assertMsg(program != null, "Program Compiled");
51 assertMsg(shader != null, "Shader Compiled");
52 shouldGenerateGLError(context, context.INVALID_VALUE, "context.compileShader(und efined)");
53 shouldGenerateGLError(context, context.INVALID_VALUE, "context.linkProgram(undef ined)");
54 shouldGenerateGLError(context, context.INVALID_VALUE, "context.attachShader(unde fined, undefined)");
55 shouldGenerateGLError(context, context.INVALID_VALUE, "context.attachShader(prog ram, undefined)");
56 shouldGenerateGLError(context, context.INVALID_VALUE, "context.attachShader(unde fined, shader)");
57 shouldGenerateGLError(context, context.INVALID_VALUE, "context.detachShader(prog ram, undefined)");
58 shouldGenerateGLError(context, context.INVALID_VALUE, "context.detachShader(unde fined, shader)");
59 shouldGenerateGLError(context, context.INVALID_VALUE, "context.shaderSource(unde fined, undefined)");
60 shouldGenerateGLError(context, context.INVALID_VALUE, "context.shaderSource(unde fined, 'foo')");
61 shouldGenerateGLError(context, context.INVALID_VALUE, "context.bindAttribLocatio n(undefined, 0, 'foo')");
62 shouldThrow("context.bindBuffer(context.ARRAY_BUFFER, 0)");
63 shouldThrow("context.bindFramebuffer(context.FRAMEBUFFER, 0)");
64 shouldThrow("context.bindRenderbuffer(context.RENDERBUFFER, 0)");
65 shouldThrow("context.bindTexture(context.TEXTURE_2D, 0)");
66 shouldGenerateGLError(context, context.NO_ERROR, "context.bindBuffer(context.ARR AY_BUFFER, null)");
67 shouldGenerateGLError(context, context.NO_ERROR, "context.bindFramebuffer(contex t.FRAMEBUFFER, null)");
68 shouldGenerateGLError(context, context.NO_ERROR, "context.bindRenderbuffer(conte xt.RENDERBUFFER, null)");
69 shouldGenerateGLError(context, context.NO_ERROR, "context.bindTexture(context.TE XTURE_2D, null)");
70 shouldGenerateGLError(context, context.NO_ERROR, "context.bindBuffer(context.ARR AY_BUFFER, undefined)");
71 shouldGenerateGLError(context, context.NO_ERROR, "context.bindFramebuffer(contex t.FRAMEBUFFER, undefined)");
72 shouldGenerateGLError(context, context.NO_ERROR, "context.bindRenderbuffer(conte xt.RENDERBUFFER, undefined)");
73 shouldGenerateGLError(context, context.NO_ERROR, "context.bindTexture(context.TE XTURE_2D, undefined)");
74 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.framebufferRe nderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, null)");
75 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.framebufferTe xture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, null , 0)");
76 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getProgramParamet er(undefined, 0)");
77 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getProgramInfoLog (undefined, 0)");
78 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getShaderParamete r(undefined, 0)");
79 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getShaderInfoLog( undefined, 0)");
80 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getShaderSource(u ndefined)");
81 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getUniform(undefi ned, null)");
82 shouldGenerateGLError(context, context.INVALID_VALUE, "context.getUniformLocatio n(undefined, 'foo')");
83
84 debug("");
85 debug("check with bindings");
86 context.bindBuffer(context.ARRAY_BUFFER, context.createBuffer());
87 context.bindTexture(context.TEXTURE_2D, context.createTexture());
88 shouldGenerateGLError(context, context.NO_ERROR, "context.bufferData(context.ARR AY_BUFFER, 1, context.STATIC_DRAW)");
89 shouldGenerateGLError(context, context.NO_ERROR, "context.getBufferParameter(con text.ARRAY_BUFFER, context.BUFFER_SIZE)");
90 shouldGenerateGLError(context, context.NO_ERROR, "context.texImage2D(context.TEX TURE_2D, 0, context.RGBA, 1, 1, 0, context.RGBA, context.UNSIGNED_BYTE, new Uint 8Array([0,0,0,0]))");
91 shouldGenerateGLError(context, context.NO_ERROR, "context.texParameteri(context. TEXTURE_2D, context.TEXTURE_MIN_FILTER, context.NEAREST)");
92 shouldGenerateGLError(context, context.NO_ERROR, "context.getTexParameter(contex t.TEXTURE_2D, context.TEXTURE_MIN_FILTER)");
93
94 debug("");
95 debug("check without bindings");
96 context.bindBuffer(context.ARRAY_BUFFER, null);
97 context.bindTexture(context.TEXTURE_2D, null);
98 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.bufferData(co ntext.ARRAY_BUFFER, 1, context.STATIC_DRAW)");
99 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.getBufferPara meter(context.ARRAY_BUFFER, context.BUFFER_SIZE)");
100 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.texImage2D(co ntext.TEXTURE_2D, 0, context.RGBA, 1, 1, 0, context.RGBA, context.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]))");
101 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.texParameteri (context.TEXTURE_2D, context.TEXTURE_MIN_FILTER, context.NEAREST)");
102 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.getTexParamet er(context.TEXTURE_2D, context.TEXTURE_MIN_FILTER)");
103
104
105 successfullyParsed = true;
106 </script>
107
108 <script src="../../resources/js-test-post.js"></script>
109 </body>
110 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698