mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #20674 - simartin:issue_20556, r=nox
Issue #20556: Implement proper checks in WebGLRenderingContext's bindBuffer() Implement missing check, about deleted buffers. --- - [X] `./mach build -d` does not report any errors - [X] `./mach build-geckolib` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #20556 - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20674) <!-- Reviewable:end -->
This commit is contained in:
commit
cb764be7cd
3 changed files with 49 additions and 0 deletions
|
@ -39217,6 +39217,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/webgl/bindBuffer.html": [
|
||||
[
|
||||
"/_mozilla/mozilla/webgl/bindBuffer.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/webgl/bufferData.html": [
|
||||
[
|
||||
"/_mozilla/mozilla/webgl/bufferData.html",
|
||||
|
@ -70856,6 +70862,10 @@
|
|||
"bc2a964c294e678b3c0e98ba83ce30a59a8bee3f",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/webgl/bindBuffer.html": [
|
||||
"659d53041373a6e40b9ab4cbf7e2afad45048377",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/webgl/bufferData.html": [
|
||||
"e58b2257043682723fbd17eac6dcbadb32c3ca3e",
|
||||
"testharness"
|
||||
|
|
32
tests/wpt/mozilla/tests/mozilla/webgl/bindBuffer.html
Normal file
32
tests/wpt/mozilla/tests/mozilla/webgl/bindBuffer.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>bindBuffer checks test (issue #20556)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
test(function() {
|
||||
var gl = document.createElement("canvas").getContext("webgl");
|
||||
|
||||
// Simple bindings should work
|
||||
var array_buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, array_buffer);
|
||||
assert_equals(gl.NO_ERROR, gl.getError());
|
||||
|
||||
var element_array_buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, element_array_buffer);
|
||||
assert_equals(gl.NO_ERROR, gl.getError());
|
||||
|
||||
// Re-bindings should not work
|
||||
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, array_buffer);
|
||||
assert_equals(gl.INVALID_OPERATION, gl.getError());
|
||||
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, element_array_buffer);
|
||||
assert_equals(gl.INVALID_OPERATION, gl.getError());
|
||||
|
||||
// Binding buffers pending deletion should fail
|
||||
var buffer = gl.createBuffer();
|
||||
gl.deleteBuffer(buffer);
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
||||
assert_equals(gl.INVALID_OPERATION, gl.getError());
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue