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

Side by Side Diff: conformance/buffers/buffer-data-array-buffer.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/buffer-bind-test.html ('k') | conformance/buffers/index-validation.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 <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("Test bufferData/bufferSubData with ArrayBuffer input");
20
21 debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=4188 4">https://bugs.webkit.org/show_bug.cgi?id=41884</a> : <code>Implement bufferDat a and bufferSubData with ArrayBuffer as input</code>');
22
23 var gl = create3DContext();
24 shouldBeNonNull("gl");
25
26 var array = new ArrayBuffer(128);
27 shouldBeNonNull("array");
28
29 var buf = gl.createBuffer();
30 shouldBeNonNull(buf);
31
32 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
33 glErrorShouldBe(gl, gl.INVALID_OPERATION);
34
35 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
36 glErrorShouldBe(gl, gl.NO_ERROR);
37
38 gl.bufferData(gl.ARRAY_BUFFER, -10, gl.STATIC_DRAW);
39 glErrorShouldBe(gl, gl.INVALID_VALUE);
40
41 // This should not crash, but the selection of the overload is ambiguous per Web IDL.
42 gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW);
43 gl.getError();
44
45 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
46 glErrorShouldBe(gl, gl.NO_ERROR);
47
48 array = new ArrayBuffer(64);
49
50 gl.bufferSubData(gl.ARRAY_BUFFER, -10, array);
51 glErrorShouldBe(gl, gl.INVALID_VALUE);
52
53 gl.bufferSubData(gl.ARRAY_BUFFER, -10, new Float32Array(8));
54 glErrorShouldBe(gl, gl.INVALID_VALUE);
55
56 gl.bufferSubData(gl.ARRAY_BUFFER, 10, array);
57 glErrorShouldBe(gl, gl.NO_ERROR);
58
59 gl.bufferSubData(gl.ARRAY_BUFFER, 10, null);
60 glErrorShouldBe(gl, gl.NO_ERROR);
61
62 successfullyParsed = true;
63 </script>
64
65 <script src="../../resources/js-test-post.js"></script>
66 </body>
67 </html>
OLDNEW
« no previous file with comments | « conformance/buffers/buffer-bind-test.html ('k') | conformance/buffers/index-validation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698