summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webgl/common.js
blob: 416c21ce9330d3f73576b6b5aa01dab06c5798ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
function getGl() {
  var c = document.createElement("canvas");
  var gl = c.getContext("experimental-webgl");
  assert_true(!!gl, "Should be able to get a context.");
  return gl;
}

function shouldGenerateGLError(cx, glError, fn) {
  test(function() {
    fn();
    assert_equals(cx.getError(), glError);
  }, "Calling " + fn + " should generate a " + glError + " error.");
}