From a92170adbbe585368e3e7a3309822661fc0c232a Mon Sep 17 00:00:00 2001 From: James Darpinian Date: Mon, 31 Aug 2020 10:39:26 -0700 Subject: [PATCH] Add test for GL error during resize (#3145) Tests for a WebKit bug that lost the context if there was an existing GL error in the context during a resize. --- .../canvas/render-after-resize-test.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sdk/tests/conformance/canvas/render-after-resize-test.html b/sdk/tests/conformance/canvas/render-after-resize-test.html index d81fe99ec6..f973d4d618 100644 --- a/sdk/tests/conformance/canvas/render-after-resize-test.html +++ b/sdk/tests/conformance/canvas/render-after-resize-test.html @@ -60,6 +60,19 @@ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]); +debug('\nCause a GL error, then resize and render.'); +gl.depthFunc(0); // Causes INVALID_ENUM +gl.canvas.width = gl.canvas.height = LARGE; +gl.clear(gl.COLOR_BUFFER_BIT); +gl.canvas.width = gl.canvas.height = SMALL; + +gl.clear(gl.COLOR_BUFFER_BIT); +wtu.drawUnitQuad(gl); + +wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]); +wtu.glErrorShouldBe(gl, gl.INVALID_ENUM); +wtu.glErrorShouldBe(gl, gl.NO_ERROR); + // - debug('\nRender, no-op resize, then depth-fail render.');