(gl.STENCIL_TEST);

  var kStencilRef = 4;
  gl.stencilOp(gl.REPLACE, gl.REPLACE, gl.REPLACE);
  gl.stencilFunc(gl.ALWAYS, kStencilRef, 0xFF);

  gl.drawArrays(gl.TRIANGLES, 0, 6);
  wtu.glErrorShouldBe(gl, gl.NO_ERROR);
  wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 0, 0, 255],
                      "stencil test should be red");
}

if (!gl) {
    testFailed("WebGL context does not exist");
} else {
    testPassed("WebGL context exists");

    program = wtu.setupProgram(gl, ["vs", "fs"], ["a_Position"]);
    