Skip to content

Commit 37ac465

Browse files
committed
add WebGLRenderingContext test
1 parent a8298a0 commit 37ac465

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

src/tests/html/canvas.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,60 @@
2727
testing.expectEqual(ctx.fillStyle, "#663399");
2828
}
2929
</script>
30+
31+
<script id=WebGLRenderingContext#getSupportedExtensions>
32+
{
33+
const element = document.createElement("canvas");
34+
const ctx = element.getContext("webgl");
35+
testing.expectEqual(true, ctx instanceof WebGLRenderingContext);
36+
37+
const supportedExtensions = ctx.getSupportedExtensions();
38+
// The order Chrome prefer.
39+
const expectedExtensions = [
40+
"ANGLE_instanced_arrays",
41+
"EXT_blend_minmax",
42+
"EXT_clip_control",
43+
"EXT_color_buffer_half_float",
44+
"EXT_depth_clamp",
45+
"EXT_disjoint_timer_query",
46+
"EXT_float_blend",
47+
"EXT_frag_depth",
48+
"EXT_polygon_offset_clamp",
49+
"EXT_shader_texture_lod",
50+
"EXT_texture_compression_bptc",
51+
"EXT_texture_compression_rgtc",
52+
"EXT_texture_filter_anisotropic",
53+
"EXT_texture_mirror_clamp_to_edge",
54+
"EXT_sRGB",
55+
"KHR_parallel_shader_compile",
56+
"OES_element_index_uint",
57+
"OES_fbo_render_mipmap",
58+
"OES_standard_derivatives",
59+
"OES_texture_float",
60+
"OES_texture_float_linear",
61+
"OES_texture_half_float",
62+
"OES_texture_half_float_linear",
63+
"OES_vertex_array_object",
64+
"WEBGL_blend_func_extended",
65+
"WEBGL_color_buffer_float",
66+
"WEBGL_compressed_texture_astc",
67+
"WEBGL_compressed_texture_etc",
68+
"WEBGL_compressed_texture_etc1",
69+
"WEBGL_compressed_texture_pvrtc",
70+
"WEBGL_compressed_texture_s3tc",
71+
"WEBGL_compressed_texture_s3tc_srgb",
72+
"WEBGL_debug_renderer_info",
73+
"WEBGL_debug_shaders",
74+
"WEBGL_depth_texture",
75+
"WEBGL_draw_buffers",
76+
"WEBGL_lose_context",
77+
"WEBGL_multi_draw",
78+
"WEBGL_polygon_mode"
79+
];
80+
81+
testing.expectEqual(expectedExtensions.length, supportedExtensions.length);
82+
for (let i = 0; i < expectedExtensions.length; i++) {
83+
testing.expectEqual(expectedExtensions[i], supportedExtensions[i]);
84+
}
85+
}
86+
</script>

0 commit comments

Comments
 (0)