OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 |
| 6 async_test(function(t) { |
| 7 var image = document.createElement('img'); |
| 8 image.src = 'http://localhost:8080/security/resources/abe.png'; |
| 9 image.addEventListener('load', function() { |
| 10 var offscreenCanvas = new OffscreenCanvas(10, 10); |
| 11 var ctx = offscreenCanvas.getContext('2d'); |
| 12 ctx.drawImage(image, 0, 0); |
| 13 offscreenCanvas.convertToBlob().then(t.step_func_done(function() { |
| 14 assert_false("convertToBlob on a tainted OffscreenCanvas didn't thro
w, but should be"); |
| 15 }), t.step_func_done(function(e) { |
| 16 assert_true(e instanceof DOMException); |
| 17 assert_equals(e.name, "SecurityError"); |
| 18 })); |
| 19 }); |
| 20 }, "Test that call convertToBlob on a tainted OffscreenCanvas throws exception")
; |
| 21 |
| 22 </script> |
| 23 |
OLD | NEW |