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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/bad-arguments-test.html

Issue 1601093008: Remove duplicated WebGL layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 <script src="resources/webgl-test-utils.js"></script>
6 </head>
7 <body>
8 <div id="description"></div>
9 <div id="console"></div>
10
11 <script>
12 if (window.internals)
13 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
14
15 var wtu = WebGLTestUtils;
16 description("Tests calling WebGL APIs with wrong argument types");
17
18 var context = wtu.create3DContext();
19 var program = wtu.loadStandardProgram(context);
20 var shader = wtu.loadStandardVertexShader(context);
21 var shouldGenerateGLError = wtu.shouldGenerateGLError;
22
23 assertMsg(program != null, "Program Compiled");
24 assertMsg(shader != null, "Shader Compiled");
25
26 var loc = context.getUniformLocation(program, "u_modelViewProjMatrix");
27 assertMsg(loc != null, "getUniformLocation succeeded");
28
29 var arguments = [
30 { value: "foo",
31 throw: true },
32 { value: 0,
33 throw: true },
34 { value: null,
35 throw: false },
36 { value: undefined,
37 throw: false }
38 ];
39
40 var argument;
41
42 function shouldBeEmptyString(command) {
43 shouldBe(command, "''");
44 }
45
46 for (var i = 0; i < arguments.length; ++i) {
47 var func, func2;
48 if (arguments[i].throw) {
49 func = shouldThrow;
50 func2 = shouldThrow;
51 } else {
52 func = shouldBeUndefined;
53 func2 = shouldBeNull;
54 }
55 argument = arguments[i].value;
56 func("context.compileShader(argument)");
57 func("context.linkProgram(argument)");
58 func("context.attachShader(program, argument)");
59 func("context.attachShader(argument, shader)");
60 func("context.detachShader(program, argument)");
61 func("context.detachShader(argument, shader)");
62 func("context.useProgram(argument)");
63 func("context.shaderSource(argument, 'foo')");
64 func("context.bindAttribLocation(argument, 0, 'foo')");
65 func("context.bindBuffer(context.ARRAY_BUFFER, argument)");
66 func("context.bindFramebuffer(context.FRAMEBUFFER, argument)");
67 func("context.bindRenderbuffer(context.RENDERBUFFER, argument)");
68 func("context.bindTexture(context.TEXTURE_2D, argument)");
69 func("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTAC HMENT, context.RENDERBUFFER, argument)");
70 func("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHME NT0, context.TEXTURE_2D, argument, 0)");
71 func("context.uniform2fv(argument, new Float32Array([0.0, 0.0]))");
72 func("context.uniform2iv(argument, new Int32Array([0, 0]))");
73 func("context.uniformMatrix2fv(argument, false, new Float32Array([0.0, 0.0, 0. 0, 0.0]))");
74
75 func2("context.getProgramInfoLog(argument)");
76 func2("context.getProgramParameter(argument, 0)");
77 func2("context.getShaderInfoLog(argument)");
78 func2("context.getShaderParameter(argument, 0)");
79 func2("context.getShaderSource(argument)");
80 func2("context.getUniform(argument, loc)");
81 func2("context.getUniform(program, argument)");
82 func2("context.getUniformLocation(argument, 'u_modelViewProjMatrix')");
83 }
84 </script>
85
86 </body>
87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698