Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | <!-- |
michael@0 | 2 | Copyright (c) 2011 The Chromium Authors. All rights reserved. |
michael@0 | 3 | Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | found in the LICENSE file. |
michael@0 | 5 | --> |
michael@0 | 6 | <!DOCTYPE html> |
michael@0 | 7 | <html> |
michael@0 | 8 | <head> |
michael@0 | 9 | <meta charset="utf-8"> |
michael@0 | 10 | <link rel="stylesheet" href="../../resources/js-test-style.css"/> |
michael@0 | 11 | <script src="../../resources/js-test-pre.js"></script> |
michael@0 | 12 | <script src="../resources/webgl-test.js"></script> |
michael@0 | 13 | </head> |
michael@0 | 14 | <body> |
michael@0 | 15 | <div id="description"></div> |
michael@0 | 16 | <div id="console"></div> |
michael@0 | 17 | |
michael@0 | 18 | <script> |
michael@0 | 19 | description("Test bufferData/bufferSubData with ArrayBuffer input"); |
michael@0 | 20 | |
michael@0 | 21 | 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>'); |
michael@0 | 22 | |
michael@0 | 23 | var gl = create3DContext(); |
michael@0 | 24 | shouldBeNonNull("gl"); |
michael@0 | 25 | |
michael@0 | 26 | var array = new ArrayBuffer(128); |
michael@0 | 27 | shouldBeNonNull("array"); |
michael@0 | 28 | |
michael@0 | 29 | var buf = gl.createBuffer(); |
michael@0 | 30 | shouldBeNonNull("buf"); |
michael@0 | 31 | |
michael@0 | 32 | gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW); |
michael@0 | 33 | glErrorShouldBe(gl, gl.INVALID_OPERATION); |
michael@0 | 34 | |
michael@0 | 35 | gl.bindBuffer(gl.ARRAY_BUFFER, buf); |
michael@0 | 36 | glErrorShouldBe(gl, gl.NO_ERROR); |
michael@0 | 37 | |
michael@0 | 38 | gl.bufferData(gl.ARRAY_BUFFER, -10, gl.STATIC_DRAW); |
michael@0 | 39 | glErrorShouldBe(gl, gl.INVALID_VALUE); |
michael@0 | 40 | |
michael@0 | 41 | // This should not crash, but the selection of the overload is ambiguous per Web IDL. |
michael@0 | 42 | gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW); |
michael@0 | 43 | gl.getError(); |
michael@0 | 44 | |
michael@0 | 45 | gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW); |
michael@0 | 46 | glErrorShouldBe(gl, gl.NO_ERROR); |
michael@0 | 47 | |
michael@0 | 48 | array = new ArrayBuffer(64); |
michael@0 | 49 | |
michael@0 | 50 | gl.bufferSubData(gl.ARRAY_BUFFER, -10, array); |
michael@0 | 51 | glErrorShouldBe(gl, gl.INVALID_VALUE); |
michael@0 | 52 | |
michael@0 | 53 | gl.bufferSubData(gl.ARRAY_BUFFER, -10, new Float32Array(8)); |
michael@0 | 54 | glErrorShouldBe(gl, gl.INVALID_VALUE); |
michael@0 | 55 | |
michael@0 | 56 | gl.bufferSubData(gl.ARRAY_BUFFER, 10, array); |
michael@0 | 57 | glErrorShouldBe(gl, gl.NO_ERROR); |
michael@0 | 58 | |
michael@0 | 59 | gl.bufferSubData(gl.ARRAY_BUFFER, 10, null); |
michael@0 | 60 | glErrorShouldBe(gl, gl.NO_ERROR); |
michael@0 | 61 | |
michael@0 | 62 | successfullyParsed = true; |
michael@0 | 63 | </script> |
michael@0 | 64 | |
michael@0 | 65 | <script>finishTest();</script> |
michael@0 | 66 | </body> |
michael@0 | 67 | </html> |