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 | |
12 description("Verifies that attempting to set invalid elements to a Typed Array t
hrows an exception"); | |
13 | |
14 // Global scope so shouldThrow can see it | |
15 var typedArray, otherArray; | |
16 | |
17 function negativeTestSet(typeName) { | |
18 var type = window[typeName]; | |
19 typedArray = new type(10); | |
20 | |
21 shouldThrow("typedArray.set()"); | |
22 shouldThrow("typedArray.set('hello world')"); | |
23 | |
24 otherArray = new type(typedArray.length); | |
25 shouldThrow("typedArray.set(otherArray, 1)"); | |
26 } | |
27 | |
28 negativeTestSet("Int8Array"); | |
29 negativeTestSet("Uint8Array"); | |
30 negativeTestSet("Int16Array"); | |
31 negativeTestSet("Uint16Array"); | |
32 negativeTestSet("Int32Array"); | |
33 negativeTestSet("Uint32Array"); | |
34 negativeTestSet("Float32Array"); | |
35 | |
36 </script> | |
37 | |
38 </body> | |
39 </html> | |
40 | |
OLD | NEW |