| <!DOCTYPE html> |
| <meta charset=utf-8> |
| <title>WebGL2RenderingContext: IDL bindings</title> |
| <script src="../../../../resources/testharness.js"></script> |
| <script src="../../../../resources/testharnessreport.js"></script> |
| <div id="log"></div> |
| <script> |
| let context, error_methods = []; |
| setup(function() { |
| window.internals.settings.setWebGL2Enabled(true); |
| |
| context = document.createElement("canvas").getContext("webgl2"); |
| if (!context) { |
| throw new Error("Could not create webgl2 context"); |
| } |
| |
| for (let i = 1; i <= 4; ++i) { |
| error_methods.push([`uniform${i}uiv`, [null, null], `uniform${i}uiv with null data`]); |
| } |
| for (let dim of ["2x3", "3x2", "2x4", "4x2", "3x4", "4x3"]) { |
| error_methods.push([`uniformMatrix${dim}fv`, [null, false, null], `uniformMatrix${dim}fv with null data`]); |
| } |
| error_methods.push(["framebufferTextureLayer", [0, 0, 0, 0, 0], "framebufferTextureLayer with integer texture"]); |
| }); |
| |
| for (var [method, args, name] of error_methods) { |
| test(function() { |
| assert_throws(new TypeError(), () => context[method](...args)); |
| }, name); |
| } |
| </script> |