https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 395be6a7bcb79ff93bd3e10aec665ce1dd2f9c54 authored by Mikhail Pozdnyakov on 13 April 2018, 11:21:15 UTC
Enable WPT tests for the Generic Sensor classes
Tip revision: 395be6a
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