OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../../resources/js-test.js"></script> | |
4 <script src="resources/webgl-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <div id="description"></div> | |
8 <div id="console"></div> | |
9 | |
10 <script> | |
11 description("Test setting WebGL array with offset"); | |
12 | |
13 debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=7604
0">https://bugs.webkit.org/show_bug.cgi?id=76040</a> : <code>Int16Array.set(arra
y, offset) fails on first execution</code>'); | |
14 | |
15 var webGLArray = null; | |
16 var array = null; | |
17 var bounds = null; | |
18 | |
19 function testSetters(typeName, low, high) { | |
20 bounds = [low, high]; | |
21 var type = window[typeName]; | |
22 var array_buffer = new ArrayBuffer(32); | |
23 webGLArray = new type(array_buffer); | |
24 debug("Testing " + typeName); | |
25 array = [1, 2, low, high]; | |
26 webGLArray.set(array, 1); | |
27 shouldBe("webGLArray[0]", "0"); | |
28 shouldBe("webGLArray[1]", "1"); | |
29 shouldBe("webGLArray[2]", "2"); | |
30 shouldBe("webGLArray[3]", "bounds[0]"); | |
31 shouldBe("webGLArray[4]", "bounds[1]"); | |
32 } | |
33 | |
34 testSetters("Int8Array", -128, 127); | |
35 testSetters("Uint8Array", 0, 255); | |
36 testSetters("Int16Array", -32768, 32767); | |
37 testSetters("Uint16Array", 0, 65535); | |
38 testSetters("Int32Array", -2147483648, 2147483647); | |
39 testSetters("Uint32Array", 0, 4294967295); | |
40 testSetters("Float32Array", -2.5, 3.5); | |
41 </script> | |
42 | |
43 </body> | |
44 </html> | |
OLD | NEW |