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

Side by Side Diff: conformance/buffers/index-validation-verifies-too-many-indices.html

Issue 8342021: Add webgl conformance tests r15841. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!--
2 Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE html>
7 <html>
8 <head>
9 <meta charset="utf-8">
10 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
11 <script src="../../resources/js-test-pre.js"></script>
12 <script src="../resources/webgl-test.js"></script>
13 </head>
14 <body>
15 <div id="description"></div>
16 <div id="console"></div>
17
18 <script>
19 description('Tests that index validation for drawElements does not examine too m any indices');
20
21 var context = create3DContext();
22 var program = loadStandardProgram(context);
23
24 context.useProgram(program);
25 var vertexObject = context.createBuffer();
26 context.enableVertexAttribArray(0);
27 context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
28 // 4 vertices -> 2 triangles
29 context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
30 context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
31
32 var indexObject = context.createBuffer();
33
34 debug("Test out of range indices")
35 context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
36 context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]), context.STATIC_DRAW);
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 successfullyParsed = true;
43 </script>
44
45 <script src="../../resources/js-test-post.js"></script>
46 </body>
47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698