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

Side by Side Diff: third_party/webgl/sdk/tests/conformance/misc/bad-arguments-test.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 with wrong argument types");
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
53 var loc = context.getUniformLocation(program, "u_modelViewProjMatrix");
54 assertMsg(loc != null, "getUniformLocation succeeded");
55
56 var arguments = [
57 { value: "foo",
58 throws: true },
59 { value: 0,
60 throws: true },
61 { value: null,
62 throws: false },
63 { value: undefined,
64 throws: false }
65 ];
66
67 var argument;
68
69 function shouldBeEmptyString(command) {
70 shouldBe(command, "''");
71 }
72
73 for (var i = 0; i < arguments.length; ++i) {
74 var func, func2, func3;
75 if (arguments[i].throws) {
76 func = shouldThrow;
77 func2 = shouldThrow;
78 func3 = shouldThrow;
79 } else {
80 func = shouldBeUndefined;
81 func2 = shouldBeNull;
82 func3 = shouldBeEmptyString;
83 }
84 argument = arguments[i].value;
85 func("context.compileShader(argument)");
86 func("context.linkProgram(argument)");
87 func("context.attachShader(program, argument)");
88 func("context.attachShader(argument, shader)");
89 func("context.detachShader(program, argument)");
90 func("context.detachShader(argument, shader)");
91 func("context.useProgram(argument)");
92 func("context.shaderSource(argument, 'foo')");
93 func("context.bindAttribLocation(argument, 0, 'foo')");
94 func("context.bindBuffer(context.ARRAY_BUFFER, argument)");
95 func("context.bindFramebuffer(context.FRAMEBUFFER, argument)");
96 func("context.bindRenderbuffer(context.RENDERBUFFER, argument)");
97 func("context.bindTexture(context.TEXTURE_2D, argument)");
98 func("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTAC HMENT, context.RENDERBUFFER, argument)");
99 func("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHME NT0, context.TEXTURE_2D, argument, 0)");
100 func("context.uniform2fv(argument, new Float32Array([0.0, 0.0]))");
101 func("context.uniform2iv(argument, new Int32Array([0, 0]))");
102 func("context.uniformMatrix2fv(argument, false, new Float32Array([0.0, 0.0, 0. 0, 0.0]))");
103
104 func2("context.getProgramParameter(argument, 0)");
105 func2("context.getShaderParameter(argument, 0)");
106 func2("context.getUniform(argument, loc)");
107 func2("context.getUniform(program, argument)");
108 func2("context.getUniformLocation(argument, 'u_modelViewProjMatrix')");
109
110 func3("context.getProgramInfoLog(argument)");
111 func3("context.getShaderInfoLog(argument)");
112 func3("context.getShaderSource(argument)");
113 }
114
115 successfullyParsed = true;
116 </script>
117
118 <script src="../../resources/js-test-post.js"></script>
119 </body>
120 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698