https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 260166c7aa434d6367910af87f67fdaf51146068 authored by Lukasz Anforowicz on 02 April 2018, 20:04:17 UTC
Tests and docs for the current CORB vs <link rel="preload"> behavior.
Tip revision: 260166c
common.js
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.");
}
back to top