Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / uniform-array-length-overflow.html
blob3e3fb352fac70c062cbaf58a6671af448f350109
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>
11 description("Verifies that the array conversion code for WebGLRenderingContext.uniform* does not crash.");
13 array = [ ];
14 for (var i = 0; i < 1 << 15; ++i)
15 array[i] = 0x0c0c0c0c;
16 array.length = 0x80000000;
18 context = create3DContext();
19 intProgram = loadProgram(context, "resources/intArrayUniformShader2.vert", "resources/noopUniformShader.frag");
20 floatProgram = loadProgram(context, "resources/floatArrayUniformShader.vert", "resources/noopUniformShader.frag");
21 intLocation = context.getUniformLocation(intProgram, "u_ints");
22 floatLocation = context.getUniformLocation(floatProgram, "u_floats");
24 context.useProgram(intProgram);
25 try {
26 context.uniform4iv(intLocation, array);
27 } catch (e) { }
29 context.useProgram(floatProgram);
30 try {
31 context.uniform4fv(floatLocation, array);
32 } catch (e) { }
33 </script>
35 </body>
36 </html>