Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / index-validation-copies-indices.html
blobe738f2e4173d211b6562d705ab71c75b7729e7b5
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('Test that client data is always copied during bufferData and bufferSubData calls, because otherwise the data the GL uses to draw may differ from that checked by the index validation code.')
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 context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
30 var indices = new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]);
31 context.bufferData(context.ELEMENT_ARRAY_BUFFER, indices, 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)");
35 indices[0] = 2;
36 indices[5] = 1;
37 shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
38 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
39 shouldGenerateGLError(context, context.INVALID_OPERATION, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
41 debug("")
42 </script>
44 </body>
45 </html>