5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
10 <div id=
"content" style=
"display: none">
11 <canvas id=
"c" width=
"1" height=
"1"></canvas>
14 <script type=
"application/javascript">
16 function testInt64NonFinite(arg) {
17 // We can use a WebGLRenderingContext to test conversion to
64-bit signed
19 var gl = $(
"c").getContext(
"experimental-webgl");
21 // No WebGL support on MacOS
10.5. Just skip this test
22 todo(false,
"WebGL not supported");
25 var error = gl.getError();
27 // on the b2g emulator we get GL_INVALID_FRAMEBUFFER_OPERATION
28 if (error ==
0x0506) // GL_INVALID_FRAMEBUFFER_OPERATION
31 is(error,
0,
"Should not start in an error state");
33 var b = gl.createBuffer();
34 gl.bindBuffer(gl.ARRAY_BUFFER, b);
36 var a = new Float32Array(
1);
37 gl.bufferData(gl.ARRAY_BUFFER, a, gl.STATIC_DRAW);
39 gl.bufferSubData(gl.ARRAY_BUFFER, arg, a);
41 is(gl.getError(),
0,
"Should have treated non-finite double as 0");
44 testInt64NonFinite(NaN);
45 testInt64NonFinite(Infinity);
46 testInt64NonFinite(-Infinity);