1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/imptests/html/webgl/common.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,13 @@ 1.4 +function getGl() { 1.5 + var c = document.createElement("canvas"); 1.6 + var gl = c.getContext("experimental-webgl"); 1.7 + assert_true(!!gl, "Should be able to get a context."); 1.8 + return gl; 1.9 +} 1.10 + 1.11 +function shouldGenerateGLError(cx, glError, fn) { 1.12 + test(function() { 1.13 + fn(); 1.14 + assert_equals(cx.getError(), glError); 1.15 + }, "Calling " + fn + " should generate a " + glError + " error."); 1.16 +}