Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / bad-arguments-test.html
blob5c7bfb5f786ef043be533fb056534599ccfc4a63
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>
11 <script>
12 if (window.internals)
13 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
15 var wtu = WebGLTestUtils;
16 description("Tests calling WebGL APIs with wrong argument types");
18 var context = wtu.create3DContext();
19 var program = wtu.loadStandardProgram(context);
20 var shader = wtu.loadStandardVertexShader(context);
21 var shouldGenerateGLError = wtu.shouldGenerateGLError;
23 assertMsg(program != null, "Program Compiled");
24 assertMsg(shader != null, "Shader Compiled");
26 var loc = context.getUniformLocation(program, "u_modelViewProjMatrix");
27 assertMsg(loc != null, "getUniformLocation succeeded");
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 }
40 var argument;
42 function shouldBeEmptyString(command) {
43 shouldBe(command, "''");
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;
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_ATTACHMENT, context.RENDERBUFFER, argument)");
70 func("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, 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]))");
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')");
84 </script>
86 </body>
87 </html>