diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html')
-rw-r--r-- | dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html index c051fa36a3..f1e9a82d8a 100644 --- a/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html +++ b/dom/canvas/test/webgl-conf/checkout/conformance2/extensions/ext-disjoint-timer-query-webgl2.html @@ -25,7 +25,9 @@ description("This test verifies the functionality of the EXT_disjoint_timer_quer var wtu = WebGLTestUtils; var canvas = document.getElementById("canvas"); var gl = wtu.create3DContext(canvas, null, 2); +var gl2 = null; var ext = null; +var ext2 = null; var query = null; var query2 = null; var elapsed_query = null; @@ -62,6 +64,8 @@ if (!gl) { wtu.glErrorShouldBe(gl, gl.NO_ERROR); } verifyQueryResultsNotAvailable(); + verifyDeleteQueryBehavior(); + verifyDeleteQueryErrorBehavior(); wtu.glErrorShouldBe(gl, gl.NO_ERROR); window.requestAnimationFrame(checkQueryResults); @@ -249,6 +253,60 @@ function verifyQueryResultsNotAvailable() { testPassed("Queries' results didn't become available in a spin loop"); } +function verifyDeleteQueryBehavior() { + debug(""); + debug("Testing deleting an active query should end it."); + + // Use a new context for this test + gl2 = wtu.create3DContext(null, null, 2); + if (!gl2) return; + ext2 = gl2.getExtension("EXT_disjoint_timer_query_webgl2"); + if (!ext2) return; + + query = gl2.createQuery(); + gl2.beginQuery(ext.TIME_ELAPSED_EXT, query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "The query began successfully"); + gl2.deleteQuery(query); + wtu.glErrorShouldBe(gl2, gl2.NONE, "Deletion of the active query succeeds"); + shouldBeNull("gl2.getQuery(ext2.TIME_ELAPSED_EXT, gl2.CURRENT_QUERY)"); + shouldBeFalse("gl2.isQuery(query)"); + query = gl2.createQuery(); + gl2.beginQuery(ext2.TIME_ELAPSED_EXT, query); + wtu.glErrorShouldBe(gl, gl2.NONE, "Beginning a new query succeeds"); + gl2.endQuery(gl2.TIME_ELAPSED_EXT); + gl2.deleteQuery(query); + wtu.glErrorShouldBe(gl, gl.NONE); + query = null; + ext2 = null; + gl2 = null; +} + +function verifyDeleteQueryErrorBehavior() { + debug(""); + debug("Testing deleting a query created by another context."); + + // Use new contexts for this test + gl2 = wtu.create3DContext(null, null, 2); + var gl3 = wtu.create3DContext(null, null, 2); + if (!gl2 || !gl3) return; + ext2 = gl2.getExtension("EXT_disjoint_timer_query_webgl2"); + if (!ext2) return; + + query = gl2.createQuery(); + gl2.beginQuery(ext2.TIME_ELAPSED_EXT, query); + gl3.deleteQuery(query); + wtu.glErrorShouldBe(gl3, gl3.INVALID_OPERATION); + shouldBeTrue("gl2.isQuery(query)"); + shouldBe("gl2.getQuery(ext2.TIME_ELAPSED_EXT, gl2.CURRENT_QUERY)", "query"); + gl2.endQuery(ext2.TIME_ELAPSED_EXT); + gl2.deleteQuery(query); + wtu.glErrorShouldBe(gl2, gl2.NONE); + query = null; + ext2 = null; + gl2 = null; + gl3 = null; +} + function checkQueryResults() { if (availability_retry > 0) { // Make a reasonable attempt to wait for the queries' results to become available. |