Skip to content

Commit

Permalink
Add test for GL error during resize (KhronosGroup#3145)
Browse files Browse the repository at this point in the history
Tests for a WebKit bug that lost the context if there was an existing GL error
in the context during a resize.
  • Loading branch information
jdarpinian authored Aug 31, 2020
1 parent cb02b86 commit a92170a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sdk/tests/conformance/canvas/render-after-resize-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down

0 comments on commit a92170a

Please sign in to comment.