From 304b9f53cd159cff70c53cce3f7d3c897e1f4a23 Mon Sep 17 00:00:00 2001 From: Matt Kelly Date: Mon, 9 Apr 2012 17:05:08 -0700 Subject: [PATCH] Adding canvas-3d-standard test. --- tests/canvas-3d-standard/config.yml | 4 ++++ tests/canvas-3d-standard/test.js | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/canvas-3d-standard/config.yml create mode 100644 tests/canvas-3d-standard/test.js diff --git a/tests/canvas-3d-standard/config.yml b/tests/canvas-3d-standard/config.yml new file mode 100644 index 0000000..532959b --- /dev/null +++ b/tests/canvas-3d-standard/config.yml @@ -0,0 +1,4 @@ +--- + r: 2 + spec: "https://www.khronos.org/registry/webgl/specs/latest/" + title: "Canvas 3D, Standard" diff --git a/tests/canvas-3d-standard/test.js b/tests/canvas-3d-standard/test.js new file mode 100644 index 0000000..2f92f65 --- /dev/null +++ b/tests/canvas-3d-standard/test.js @@ -0,0 +1,20 @@ +test("Canvas 3D Context, standard", function() { + var 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( which === "webgl", "webgl standard, supported" ); +});