gecko/testing/web-platform/tests/webgl/common.js
James Graham 3dfd6c1bac Bug 945222 - Initial import of web-platform-tests testsuite 1/4: test data
--HG--
extra : rebase_source : d635a4f39c587d4d381b486dd63de747865b77a2
2014-09-04 12:48:31 +01:00

14 lines
377 B
JavaScript

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.");
}