OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="/js-test-resources/js-test.js"></script> | 4 <script src="/js-test-resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 description("The image bitmap factories should throw exceptions on cross
-origin access."); | 6 description("The image bitmap factories should throw exceptions on cross
-origin access."); |
7 | 7 |
8 window.jsTestIsAsync = true; | 8 window.jsTestIsAsync = true; |
9 | 9 |
10 var img = document.createElement('img'); | 10 var img = document.createElement('img'); |
| 11 var vid = document.createElement('video'); |
| 12 |
11 document.body.appendChild(img); | 13 document.body.appendChild(img); |
12 img.src = 'http://localhost:8080/security/resources/abe.png'; | 14 img.src = 'http://localhost:8080/security/resources/abe.png'; |
13 | 15 img.addEventListener('load', function () { |
14 shouldThrow('createImageBitmap(img, 0, 0, 10, 10)', '"SecurityError: Fai
led to execute \'createImageBitmap\' on \'Window\': Cross-origin access to the s
ource image is denied."'); | 16 shouldThrow('createImageBitmap(img, 0, 0, 10, 10)', '"SecurityError:
Failed to execute \'createImageBitmap\' on \'Window\': Cross-origin access to t
he source image is denied."'); |
15 | 17 |
16 var vid = document.createElement('video'); | 18 vid.src = 'http://localhost:8080/media/resources/load-video.php?name
=test.ogv&type=video/ogv'; |
17 vid.src = 'http://localhost:8080/media/resources/load-video.php?name=tes
t.ogv&type=video/ogv'; | 19 vid.addEventListener('playing', function () { |
18 vid.addEventListener('playing', function () { | 20 shouldThrow('createImageBitmap(vid, 0, 0, 10, 10)', '"SecurityEr
ror: Failed to execute \'createImageBitmap\' on \'Window\': Cross-origin access
to the source video is denied."'); |
19 shouldThrow('createImageBitmap(vid, 0, 0, 10, 10)', '"SecurityError:
Failed to execute \'createImageBitmap\' on \'Window\': Cross-origin access to t
he source video is denied."'); | 21 finishJSTest(); |
20 finishJSTest(); | 22 }); |
| 23 document.body.appendChild(vid); |
| 24 vid.play(); |
21 }); | 25 }); |
22 document.body.appendChild(vid); | |
23 vid.play(); | |
24 </script> | 26 </script> |
25 </body> | 27 </body> |
26 </html> | 28 </html> |
OLD | NEW |