1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
6 <title>WebGL gl.ENABLE enums Conformance Tests
</title>
7 <script src=
"resources/desktop-gl-constants.js" type=
"text/javascript"></script>
8 <script src=
"../../../resources/js-test.js"></script>
9 <script src=
"resources/webgl-test.js"></script>
12 <div id=
"description"></div>
13 <div id=
"console"></div>
14 <canvas id=
"canvas" width=
"2" height=
"2"> </canvas>
16 description("This test ensures WebGL implementations allow OpenGL ES 2.0 features to be turned on but not non OpenGL ES 2.0 features.");
19 debug("Canvas.getContext");
22 window
.internals
.settings
.setWebGLErrorsToConsoleEnabled(false);
24 var gl
= create3DContext(document
.getElementById("canvas"));
26 testFailed("context does not exist");
28 testPassed("context exists");
31 debug("Checking gl.ENABLE enums.");
55 'MAP1_TEXTURE_COORD_1',
56 'MAP1_TEXTURE_COORD_2',
57 'MAP1_TEXTURE_COORD_3',
58 'MAP1_TEXTURE_COORD_4',
64 'MAP2_TEXTURE_COORD_1',
65 'MAP2_TEXTURE_COORD_2',
66 'MAP2_TEXTURE_COORD_3',
67 'MAP2_TEXTURE_COORD_4',
75 'POLYGON_OFFSET_LINE',
76 'POLYGON_OFFSET_POINT',
79 'POST_COLOR_MATRIX_COLOR_TABLE',
80 'POST_CONVOLUTION_COLOR_TABLE',
82 'SAMPLE_ALPHA_TO_ONE',
92 'VERTEX_PROGRAM_POINT_SIZE',
93 'VERTEX_PROGRAM_TWO_SIDE'
96 for (var ii
= 0; ii
< invalidEnums
.length
; ++ii
) {
97 var name
= invalidEnums
[ii
];
98 gl
.enable(desktopGL
[name
]);
99 assertMsg(gl
.getError() == gl
.INVALID_ENUM
,
100 "gl.enable must set INVALID_ENUM when passed GL_" + name
);
108 'POLYGON_OFFSET_FILL',
109 'SAMPLE_ALPHA_TO_COVERAGE',
115 for (var ii
= 0; ii
< validEnums
.length
; ++ii
) {
116 var name
= validEnums
[ii
];
118 assertMsg(gl
.getError() == gl
.NO_ERROR
,
119 "gl.enable must succeed when passed gl." + name
);