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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-convertToBlob-exceptions.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script id="myWorker" type="text/worker">
5 self.onmessage = function(e) {
6 };
7 </script>
8 <script>
9
10 function makeWorker(script)
11 {
12 var blob = new Blob([script]);
13 return new Worker(URL.createObjectURL(blob));
14 }
15
16 async_test(function(t) {
17 var worker = makeWorker(document.getElementById("myWorker").textContent);
18 var offscreenCanvas = new OffscreenCanvas(10, 10);
19 worker.postMessage({offscreenCanvas}, [offscreenCanvas]);
20 offscreenCanvas.convertToBlob().then(t.step_func_done(function() {
21 assert_false("convertToBlob didn't throw, but should be");
22 }), t.step_func_done(function(e) {
23 assert_true(e instanceof DOMException);
24 assert_equals(e.name, "InvalidStateError");
25 }));
26 }, "Test that call convertToBlob on a detached OffscreenCanvas throws exception" );
27
28 async_test(function(t) {
29 var offscreenCanvas = new OffscreenCanvas(0, 0);
30 offscreenCanvas.convertToBlob().then(t.step_func_done(function() {
31 assert_false("convertToBlob didn't throw, but should be");
32 }), t.step_func_done(function(e) {
33 assert_true(e instanceof DOMException);
34 assert_equals(e.name, "IndexSizeError");
35 }));
36 }, "Test that call convertToBlob on a OffscreenCanvas with size 0 throws excepti on");
37
38 </script>
39
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698