OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <body> | |
4 <script src="/js-test-resources/js-test.js"></script> | |
5 <script> | |
6 description("WebGL's texImage2D should throw security error when the ImageBitmap is not origin clean."); | |
Justin Novosad
2016/01/11 21:08:53
Nit: "throw security error" -> "throw a SecurityEr
xidachen
2016/01/12 02:35:50
Acknowledged.
| |
7 | |
8 window.jsTestIsAsync = true; | |
9 var gl; | |
10 var bitmap; | |
11 | |
12 var image = document.createElement('img'); | |
13 image.src = 'http://localhost:8080/security/resources/abe.png'; | |
14 | |
15 image.addEventListener('load', function() { | |
16 var canvas = document.createElement("canvas"); | |
17 canvas.width = 10; | |
18 canvas.height = 10; | |
19 | |
20 gl = canvas.getContext("webgl"); | |
21 createImageBitmap(image, 0, 0, 10, 10).then(imageBitmap => { | |
22 bitmap = imageBitmap; | |
23 shouldThrow("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGN ED_BYTE, bitmap)"); | |
Justin Novosad
2016/01/11 21:08:53
I think you should make a call to texImage2D that
xidachen
2016/01/12 02:35:50
Acknowledged.
| |
24 finishJSTest(); | |
25 }, () => { | |
26 testFailed("Unexpected failure"); | |
27 finishJSTest(); | |
28 }); | |
29 }); | |
30 </script> | |
31 </body> | |
32 </html> | |
OLD | NEW |