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

Side by Side Diff: conformance/buffers/buffer-bind-test.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
« no previous file with comments | « conformance/buffers/00_test_list.txt ('k') | conformance/buffers/buffer-data-array-buffer.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <title>WebGL BindBuffer conformance test.</title>
11 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
12 <script src="../../resources/js-test-pre.js"></script>
13 <script src="../resources/webgl-test.js"> </script>
14 </head>
15 <body>
16 <canvas id="example" width="40" height="40" style="width: 40px; height: 40px;">< /canvas>
17 <div id="description"></div>
18 <div id="console"></div>
19 <script>
20 description("Checks a buffer can only be bound to 1 target.");
21
22 debug("");
23 debug("Canvas.getContext");
24
25 var gl = create3DContext(document.getElementById("canvas"));
26 if (!gl) {
27 testFailed("context does not exist");
28 } else {
29 testPassed("context exists");
30
31 debug("");
32
33 var buf = gl.createBuffer();
34 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
35 glErrorShouldBe(gl, gl.NO_ERROR,
36 "should be able to bind buffer.");
37 gl.bindBuffer(gl.ARRAY_BUFFER, null);
38 glErrorShouldBe(gl, gl.NO_ERROR,
39 "should be able to unbind buffer.");
40 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
41 glErrorShouldBe(gl, gl.INVALID_OPERATION,
42 "should get INVALID_OPERATION if attempting to bind buffer to differ ent target");
43
44 var buf = gl.createBuffer();
45 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
46 glErrorShouldBe(gl, gl.NO_ERROR,
47 "should be able to bind buffer.");
48 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
49 glErrorShouldBe(gl, gl.NO_ERROR,
50 "should be able to unbind buffer.");
51 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
52 glErrorShouldBe(gl, gl.INVALID_OPERATION,
53 "should get INVALID_OPERATION if attempting to bind buffer to differ ent target");
54 }
55
56 debug("");
57 successfullyParsed = true;
58 </script>
59 <script src="../../resources/js-test-post.js"></script>
60
61 </body>
62 </html>
63
OLDNEW
« no previous file with comments | « conformance/buffers/00_test_list.txt ('k') | conformance/buffers/buffer-data-array-buffer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698