Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / array-get-and-set-method-removal.html
blobf5425d77586eccc4802f9dbb2a1ec5c486250ce4
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 the get method, and the set method for individual elements, on the WebGLArray types no longer exist.");
14 debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=38039">https://bugs.webkit.org/show_bug.cgi?id=38039</a>');
16 // Global scope so shouldThrow can see it
17 var webGLArray;
19 function negativeTestGetAndSetMethods(typeName) {
20 var type = window[typeName];
21 webGLArray = new type([2, 3]);
22 shouldBeUndefined("webGLArray.get");
23 var exceptionThrown = false;
24 // We deliberately check for an exception here rather than using
25 // shouldThrow here because the precise contents of the syntax
26 // error are not specified.
27 try {
28 webGLArray.set(0, 1);
29 } catch (e) {
30 exceptionThrown = true;
32 var output = "webGLArray.set(0, 1) ";
33 if (exceptionThrown) {
34 testPassed(output + "threw exception.");
35 } else {
36 testFailed(output + "did not throw exception.");
40 negativeTestGetAndSetMethods("Int8Array");
41 negativeTestGetAndSetMethods("Uint8Array");
42 negativeTestGetAndSetMethods("Int16Array");
43 negativeTestGetAndSetMethods("Uint16Array");
44 negativeTestGetAndSetMethods("Int32Array");
45 negativeTestGetAndSetMethods("Uint32Array");
46 negativeTestGetAndSetMethods("Float32Array");
48 </script>
50 </body>
51 </html>