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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/index-validation-copies-indices.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 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9
10 <script>
11 description('Test that client data is always copied during bufferData and buffer SubData calls, because otherwise the data the GL uses to draw may differ from th at checked by the index validation code.')
12
13 if (window.internals)
14 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
15
16 var context = create3DContext();
17 var program = loadStandardProgram(context);
18
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);
26
27 var indexObject = context.createBuffer();
28
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.T RIANGLE_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.T RIANGLE_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)");
40
41 debug("")
42 </script>
43
44 </body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698