| OLD | NEW |
| (Empty) |
| 1 | |
| 2 <html xmlns="http://www.w3.org/1999/xhtml"> | |
| 3 <head> | |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| 5 <title>WebGL gl calls Conformance Tests</title> | |
| 6 <script src="../../../resources/js-test.js"></script> | |
| 7 <script src="resources/webgl-test.js"></script> | |
| 8 </head> | |
| 9 <body> | |
| 10 <div id="description"></div> | |
| 11 <div id="console"></div> | |
| 12 <canvas id="canvas" width="2" height="2"> </canvas> | |
| 13 | |
| 14 <script> | |
| 15 | |
| 16 description("This test ensures basic functionality of the underlying graphics li
brary"); | |
| 17 | |
| 18 debug(""); | |
| 19 debug("Canvas.getContext"); | |
| 20 | |
| 21 var context = create3DContext(document.getElementById("canvas")); | |
| 22 if (!context) | |
| 23 testFailed("context does not exist"); | |
| 24 else { | |
| 25 testPassed("context exists"); | |
| 26 | |
| 27 debug(""); | |
| 28 debug("Context is correct type"); | |
| 29 if (context instanceof WebGLRenderingContext) | |
| 30 testPassed("context is correct type"); | |
| 31 else | |
| 32 testFailed("context is not correct type"); | |
| 33 | |
| 34 debug(""); | |
| 35 debug("Context contains getError"); | |
| 36 if ("getError" in context) | |
| 37 testPassed("context contains getError"); | |
| 38 else | |
| 39 testFailed("context does not contains getError"); | |
| 40 | |
| 41 debug(""); | |
| 42 debug("Check default values"); | |
| 43 shouldBe('context.getParameter(context.ACTIVE_TEXTURE)', 'context.TEXTURE0')
; | |
| 44 shouldBe('(context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[0] == 1) |
| (context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[1] == 1)', 'true'); | |
| 45 shouldBe('(context.getParameter(context.ALIASED_POINT_SIZE_RANGE)[0] == 1) |
| (context.getParameter(context.ALIASED_POINT_SIZE_RANGE)[1] == 1)', 'true'); | |
| 46 shouldBe('context.getParameter(context.ARRAY_BUFFER_BINDING)', 'null'); | |
| 47 shouldBe('context.getParameter(context.BLEND)', 'false'); | |
| 48 shouldBe('context.getParameter(context.BLEND_COLOR)', '[0, 0, 0, 0]'); | |
| 49 shouldBe('context.getParameter(context.BLEND_DST_ALPHA)', '0'); | |
| 50 shouldBe('context.getParameter(context.BLEND_DST_RGB)', '0'); | |
| 51 shouldBe('context.getParameter(context.BLEND_EQUATION_ALPHA)', 'context.FUNC
_ADD'); | |
| 52 shouldBe('context.getParameter(context.BLEND_EQUATION_RGB)', 'context.FUNC_A
DD'); | |
| 53 shouldBe('context.getParameter(context.BLEND_SRC_ALPHA)', '1'); | |
| 54 shouldBe('context.getParameter(context.BLEND_SRC_RGB)', '1'); | |
| 55 shouldBe('context.getParameter(context.COLOR_CLEAR_VALUE)', '[0, 0, 0, 0]'); | |
| 56 shouldBe('context.getParameter(context.COLOR_WRITEMASK)', '[true, true, true
, true]'); | |
| 57 shouldBe('context.getParameter(context.CULL_FACE)', 'false'); | |
| 58 shouldBe('context.getParameter(context.CULL_FACE_MODE)', 'context.BACK'); | |
| 59 shouldBe('context.getParameter(context.CURRENT_PROGRAM)', 'null'); | |
| 60 shouldBe('context.getParameter(context.DEPTH_CLEAR_VALUE)', '1'); | |
| 61 shouldBe('context.getParameter(context.DEPTH_FUNC)', 'context.LESS'); | |
| 62 shouldBe('context.getParameter(context.DEPTH_RANGE)', '[0, 1]'); | |
| 63 shouldBe('context.getParameter(context.DEPTH_TEST)', 'false'); | |
| 64 shouldBe('context.getParameter(context.DEPTH_WRITEMASK)', 'true'); | |
| 65 shouldBe('context.getParameter(context.DITHER)', 'true'); | |
| 66 shouldBe('context.getParameter(context.ELEMENT_ARRAY_BUFFER_BINDING)', 'null
'); | |
| 67 shouldBe('context.getParameter(context.FRONT_FACE)', 'context.CCW'); | |
| 68 shouldBe('context.getParameter(context.GENERATE_MIPMAP_HINT)', 'context.DONT
_CARE'); | |
| 69 shouldBe('context.getParameter(context.LINE_WIDTH)', '1'); | |
| 70 shouldBe('context.getParameter(context.POLYGON_OFFSET_FACTOR)', '0'); | |
| 71 shouldBe('context.getParameter(context.POLYGON_OFFSET_FILL)', 'false'); | |
| 72 shouldBe('context.getParameter(context.POLYGON_OFFSET_UNITS)', '0'); | |
| 73 shouldBe('context.getParameter(context.RENDERBUFFER_BINDING)', 'null'); | |
| 74 shouldBe('context.getParameter(context.SAMPLE_COVERAGE_INVERT)', 'false'); | |
| 75 shouldBe('context.getParameter(context.SAMPLE_COVERAGE_VALUE)', '1'); | |
| 76 shouldBe('context.getParameter(context.SCISSOR_BOX)[0]', '0'); | |
| 77 shouldBe('context.getParameter(context.SCISSOR_BOX)[1]', '0'); | |
| 78 shouldBe('context.getParameter(context.SCISSOR_TEST)', 'false'); | |
| 79 shouldBe('context.getParameter(context.STENCIL_BACK_FAIL)', 'context.KEEP'); | |
| 80 shouldBe('context.getParameter(context.STENCIL_BACK_FUNC)', 'context.ALWAYS'
); | |
| 81 shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'cont
ext.KEEP'); | |
| 82 shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'cont
ext.KEEP'); | |
| 83 shouldBe('context.getParameter(context.STENCIL_BACK_REF)', '0'); | |
| 84 | |
| 85 shouldBe('context.getParameter(context.STENCIL_BACK_VALUE_MASK)', '0xFFFFFFF
F'); | |
| 86 shouldBe('context.getParameter(context.STENCIL_BACK_WRITEMASK)', '0xFFFFFFFF
'); | |
| 87 | |
| 88 // If EXT_packed_depth_stencil is supported, STENCIL_BITS > 0; otherwise, ST
ENCIL_BITS == 0. | |
| 89 shouldBe('context.getParameter(context.STENCIL_BITS) >= 0', 'true'); | |
| 90 shouldBe('context.getParameter(context.STENCIL_CLEAR_VALUE)', '0'); | |
| 91 shouldBe('context.getParameter(context.STENCIL_FAIL)', 'context.KEEP'); | |
| 92 shouldBe('context.getParameter(context.STENCIL_FUNC)', 'context.ALWAYS'); | |
| 93 shouldBe('context.getParameter(context.STENCIL_PASS_DEPTH_FAIL)', 'context.K
EEP'); | |
| 94 shouldBe('context.getParameter(context.STENCIL_PASS_DEPTH_PASS)', 'context.K
EEP'); | |
| 95 shouldBe('context.getParameter(context.STENCIL_REF)', '0'); | |
| 96 shouldBe('context.getParameter(context.STENCIL_TEST)', 'false'); | |
| 97 | |
| 98 shouldBe('context.getParameter(context.STENCIL_VALUE_MASK)', '0xFFFFFFFF'); | |
| 99 shouldBe('context.getParameter(context.STENCIL_WRITEMASK)', '0xFFFFFFFF'); | |
| 100 | |
| 101 shouldBe('context.getParameter(context.TEXTURE_BINDING_2D)', 'null'); | |
| 102 shouldBe('context.getParameter(context.TEXTURE_BINDING_CUBE_MAP)', 'null'); | |
| 103 shouldBe('context.getParameter(context.UNPACK_ALIGNMENT)', '4'); | |
| 104 shouldBe('context.getParameter(context.UNPACK_FLIP_Y_WEBGL)', 'false'); | |
| 105 shouldBe('context.getParameter(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL)', 'fa
lse'); | |
| 106 shouldBe('context.getParameter(context.VIEWPORT)', '[0, 0, 2, 2]'); | |
| 107 shouldBeTrue('context.getParameter(context.MAX_FRAGMENT_UNIFORM_VECTORS) >=
16'); | |
| 108 shouldBeTrue('context.getParameter(context.MAX_VERTEX_UNIFORM_VECTORS) >= 12
8'); | |
| 109 shouldBeTrue('context.getParameter(context.MAX_VARYING_VECTORS) >= 8'); | |
| 110 shouldBe('context.getParameter(context.COMPRESSED_TEXTURE_FORMATS)', '[]'); | |
| 111 } | |
| 112 | |
| 113 debug(""); | |
| 114 | |
| 115 </script> | |
| 116 | |
| 117 <script> | |
| 118 </script> | |
| 119 | |
| 120 </body> | |
| 121 </html> | |
| OLD | NEW |