diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html')
-rw-r--r-- | dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html new file mode 100644 index 0000000000..bfba0abc86 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html @@ -0,0 +1,75 @@ +<!-- +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +--> +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<link rel="stylesheet" href="../../resources/js-test-style.css"/> +<script src="../../js/js-test-pre.js"></script> +<script src="../../js/webgl-test-utils.js"></script> +</head> +<body> +<div id="description"></div> +<div id="console"></div> + +<script> +"use strict"; +description("Tests generation of synthetic and real GL errors"); + +var wtu = WebGLTestUtils; +var context = wtu.create3DContext(); +var program = wtu.loadStandardProgram(context); + +// Other tests like incorrect-context-object-behaviour already test the raising +// of many synthetic GL errors. This test verifies the raising of certain +// known real GL errors, and contains a few regression tests for bugs +// discovered in the synthetic error generation and in the WebGL +// implementation itself. + +wtu.glErrorShouldBe(context, context.NO_ERROR); + +debug("Testing getActiveAttrib"); +shouldThrow("context.getActiveAttrib(null, 2)"); +wtu.glErrorShouldBe(context, context.NO_ERROR); +// Error state should be clear by this point +wtu.glErrorShouldBe(context, context.NO_ERROR); +// Real OpenGL error +shouldBeNull("context.getActiveAttrib(program, 2)"); +wtu.glErrorShouldBe(context, context.INVALID_VALUE); +// Error state should be clear by this point +wtu.glErrorShouldBe(context, context.NO_ERROR); + +debug("Testing getActiveUniform"); +shouldThrow("context.getActiveUniform(null, 0)"); +wtu.glErrorShouldBe(context, context.NO_ERROR); +// Error state should be clear by this point +wtu.glErrorShouldBe(context, context.NO_ERROR); +// Real OpenGL error +shouldBeNull("context.getActiveUniform(program, 50)"); +wtu.glErrorShouldBe(context, context.INVALID_VALUE); +// Error state should be clear by this point +wtu.glErrorShouldBe(context, context.NO_ERROR); + +debug("Testing attempts to manipulate the default framebuffer"); +shouldBeUndefined("context.bindFramebuffer(context.FRAMEBUFFER, null)"); +wtu.glErrorShouldBe(context, context.NO_ERROR); +shouldBeUndefined("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, null)"); +// Synthetic OpenGL error +wtu.glErrorShouldBe(context, context.INVALID_OPERATION); +// Error state should be clear by this point +wtu.glErrorShouldBe(context, context.NO_ERROR); +shouldBeUndefined("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, null, 0)"); +// Synthetic OpenGL error +wtu.glErrorShouldBe(context, context.INVALID_OPERATION); +// Error state should be clear by this point +wtu.glErrorShouldBe(context, context.NO_ERROR); + +var successfullyParsed = true; +</script> + +<script src="../../js/js-test-post.js"></script> +</body> +</html> |