Bug 1941128 - Turn off network.dns.native_https_query on Mac again
[gecko.git] / dom / bindings / test / test_integers.html
blob765ed1993d9caeac5f2611ac59768678898ec9d2
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
7 </head>
8 <body>
9 <p id="display"></p>
10 <div id="content" style="display: none">
11 <canvas id="c" width="1" height="1"></canvas>
12 </div>
13 <pre id="test">
14 <script type="application/javascript">
16 function testInt64NonFinite(arg) {
17 // We can use a WebGLRenderingContext to test conversion to 64-bit signed
18 // ints edge cases.
19 var gl = $("c").getContext("experimental-webgl");
20 if (!gl) {
21 // No WebGL support on MacOS 10.5. Just skip this test
22 todo(false, "WebGL not supported");
23 return;
25 var error = gl.getError();
27 // on the b2g emulator we get GL_INVALID_FRAMEBUFFER_OPERATION
28 if (error == 0x0506) // GL_INVALID_FRAMEBUFFER_OPERATION
29 return;
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);
47 </script>
48 </pre>
49 </body>
50 </html>