Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / array-set-invalid-arguments.html
blob8ecfd9f8299f24939deccf84aa240021e60d05c0
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>
10 <script>
12 description("Verifies that attempting to set invalid elements to a Typed Array throws an exception");
14 // Global scope so shouldThrow can see it
15 var typedArray, otherArray;
17 function negativeTestSet(typeName) {
18 var type = window[typeName];
19 typedArray = new type(10);
21 shouldThrow("typedArray.set()");
22 shouldThrow("typedArray.set('hello world')");
24 otherArray = new type(typedArray.length);
25 shouldThrow("typedArray.set(otherArray, 1)");
28 negativeTestSet("Int8Array");
29 negativeTestSet("Uint8Array");
30 negativeTestSet("Int16Array");
31 negativeTestSet("Uint16Array");
32 negativeTestSet("Int32Array");
33 negativeTestSet("Uint32Array");
34 negativeTestSet("Float32Array");
36 </script>
38 </body>
39 </html>