Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html

Issue 2520973002: Fix a small error in exception handling in convertToBlob (Closed)
Patch Set: address comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698