Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / index-validation-verifies-too-many-indices.html
blobdec1e8c3af537cfe07da2fa5e8e556316a0bbc52
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
10 <script>
11 description('Tests that index validation for drawElements does not examine too many indices');
13 if (window.internals)
14 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
16 var context = create3DContext();
17 var program = loadStandardProgram(context);
19 context.useProgram(program);
20 var vertexObject = context.createBuffer();
21 context.enableVertexAttribArray(0);
22 context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
23 // 4 vertices -> 2 triangles
24 context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
25 context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
27 var indexObject = context.createBuffer();
29 debug("Test out of range indices")
30 context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
31 context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]), context.STATIC_DRAW);
32 shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
33 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
34 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
36 debug("")
37 </script>
39 </body>
40 </html>