Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / canvas / test / webgl-mochitest / test_imagedata_transfered_arraybuffer.html
blob18eed39a4361089c545244f2c2eeb4fa41a49f9d
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset=utf-8>
5 <script src='/tests/SimpleTest/SimpleTest.js'></script>
6 <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
7 </head>
8 <body>
9 <script>
10 'use strict';
11 const ab = new ArrayBuffer(4);
12 const ta = new Uint8ClampedArray(ab);
13 const idata = new ImageData(ta, 1);
14 const canvas = document.createElement('canvas');
15 const gl = canvas.getContext('webgl2');
16 const worker = new Worker('worker.js');
17 worker.postMessage([ab], [ab]);
18 gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 1, gl.RGB, idata.width, idata.height, 0, gl.RGB, gl.UNSIGNED_SHORT_5_6_5, idata);
19 const err = gl.getError();
20 window.ok = window.ok || console.log;
21 ok(err == gl.INVALID_VALUE, 'texImage2D(ImageData) with Transferred ArrayBuffer is INVALID_VALUE');
22 </script>
23 </body>
24 </html>