diff --git a/tests/canvas-3d/config.yml b/tests/canvas-3d/config.yml new file mode 100644 index 0000000..abb2f76 --- /dev/null +++ b/tests/canvas-3d/config.yml @@ -0,0 +1,4 @@ +--- + r: 2 + spec: "https://www.khronos.org/registry/webgl/specs/latest/" + title: "Canvas 3D" diff --git a/tests/canvas-3d/fixture.html b/tests/canvas-3d/fixture.html new file mode 100644 index 0000000..8f435bb --- /dev/null +++ b/tests/canvas-3d/fixture.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tests/canvas-3d/iframe.html b/tests/canvas-3d/iframe.html new file mode 100644 index 0000000..08b362a --- /dev/null +++ b/tests/canvas-3d/iframe.html @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/tests/canvas-3d/test.js b/tests/canvas-3d/test.js new file mode 100644 index 0000000..f7346c6 --- /dev/null +++ b/tests/canvas-3d/test.js @@ -0,0 +1,28 @@ +test("Canvas 3D", function() { + var WebGLRenderingContext = window.WebGLRenderingContext; + + assert( !!WebGLRenderingContext, "WebGLRenderingContext supported" ); +}); + + +test("Canvas 3D Context", function() { + var WebGLRenderingContext = window.WebGLRenderingContext, + canvas = document.createElement("canvas"), + contexts = [ + "3d", "webgl", "experimental-webgl", + "moz-webgl", "webkit-3d", "opera-3d", "ms-webgl", "ms-3d" + ], + which, + context; + + while ( contexts.length ) { + which = contexts.pop(); + context = canvas.getContext( which ); + + if ( context ) { + break; + } + } + + assert( !!WebGLRenderingContext, "WebGLRenderingContext supported (" + which + ")" ); +});