Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / buffer-data-array-buffer.html
blobafb207e784c60930d77bf09b3fafbd0236bed88a
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 bufferData/bufferSubData with ArrayBuffer input");
13 debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=41884">https://bugs.webkit.org/show_bug.cgi?id=41884</a> : <code>Implement bufferData and bufferSubData with ArrayBuffer as input</code>');
15 if (window.internals)
16 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
18 var gl = create3DContext();
19 shouldBeNonNull("gl");
21 var array = new ArrayBuffer(128);
22 shouldBeNonNull("array");
24 var buf = gl.createBuffer();
25 shouldBeNonNull(buf);
27 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
28 glErrorShouldBe(gl, gl.INVALID_OPERATION);
30 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
31 glErrorShouldBe(gl, gl.NO_ERROR);
33 gl.bufferData(gl.ARRAY_BUFFER, -10, gl.STATIC_DRAW);
34 glErrorShouldBe(gl, gl.INVALID_VALUE);
36 // This should not crash, but the selection of the overload is ambiguous per Web IDL.
37 gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW);
38 gl.getError();
40 gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
41 glErrorShouldBe(gl, gl.NO_ERROR);
43 array = new ArrayBuffer(64);
45 gl.bufferSubData(gl.ARRAY_BUFFER, -10, array);
46 glErrorShouldBe(gl, gl.INVALID_VALUE);
48 gl.bufferSubData(gl.ARRAY_BUFFER, -10, new Float32Array(8));
49 glErrorShouldBe(gl, gl.INVALID_VALUE);
51 gl.bufferSubData(gl.ARRAY_BUFFER, 10, array);
52 glErrorShouldBe(gl, gl.NO_ERROR);
54 gl.bufferSubData(gl.ARRAY_BUFFER, 10, null);
55 glErrorShouldBe(gl, gl.NO_ERROR);
56 </script>
58 </body>
59 </html>