Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / webgl / shader-deleted-by-accessor.html
blob8b4abe4a92e6d0ab1eac3caf5256274b06489edb
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 <script src="resources/webgl-test-utils.js"></script>
6 </head>
7 <body>
8 <div id="description"></div>
9 <div id="console"></div>
11 <script>
13 description("Verifies that WebGLRenderingContext::getAttachedShaders doesn't crash when an accessor property is defined on Array.prototype.");
15 if (window.internals)
16 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
18 context = create3DContext();
19 program = context.createProgram();
21 shader1 = context.createShader(context.VERTEX_SHADER);
22 context.attachShader(program, shader1);
24 for (var i = 0; i < 10; ++i) {
25 shader2 = context.createShader(context.FRAGMENT_SHADER);
26 context.attachShader(program, shader2);
28 Array.prototype.__defineSetter__(0, function() {
29 context.detachShader(program, shader2);
30 context.deleteShader(shader2);
31 shader2 = null;
32 gc();
33 });
35 shaders = context.getAttachedShaders(program);
36 context.getShaderParameter(shaders[1], 0);
38 </script>
40 </body>
41 </html>