4 <script src="/js-test-resources/js-test-pre.js"></script>
6 description("The image bitmap factories should throw exceptions on cross-origin access.");
8 window.jsTestIsAsync = true;
10 var img = document.createElement('img');
11 document.body.appendChild(img);
12 img.src = 'http://localhost:8080/security/resources/abe.png';
14 shouldThrow('createImageBitmap(img, 0, 0, 10, 10)', '"SecurityError: Failed to execute \'createImageBitmap\' on \'ImageBitmapFactories\': cross-origin access to the source image is denied."');
16 var vid = document.createElement('video');
17 vid.src = 'http://localhost:8080/media/resources/load-video.php?name=test.ogv&type=video/ogv';
18 vid.addEventListener('playing', function () {
19 shouldThrow('createImageBitmap(vid, 0, 0, 10, 10)', '"SecurityError: Failed to execute \'createImageBitmap\' on \'ImageBitmapFactories\': cross-origin access to the source video is denied."');
22 document.body.appendChild(vid);