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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions.html

Issue 2294383002: Make OffscreenCanvas a member of CanvasImageSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 months 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
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 8
9 description("Test OffscreenCanvas transferable with exception cases."); 9 description("Test OffscreenCanvas transferable with exception cases.");
10 10
11 var worker = new Worker('./resources/OffscreenCanvas-transferable.js'); 11 var worker = new Worker('./resources/OffscreenCanvas-transferable.js');
12 12
13 var width = 50; 13 var width = 50;
14 var height = 50; 14 var height = 50;
15 var offscreenCanvas1 = new OffscreenCanvas(width, height); 15 var offscreenCanvas1 = new OffscreenCanvas(width, height);
16 16
17 var ctx; 17 var ctx;
18 shouldNotThrow("ctx = offscreenCanvas1.getContext('2d')"); 18 shouldNotThrow("ctx = offscreenCanvas1.getContext('2d')");
19 shouldBeType("ctx", "OffscreenCanvasRenderingContext2D"); 19 shouldBeType("ctx", "OffscreenCanvasRenderingContext2D");
20 shouldThrow("worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1])"); 20 shouldThrow("worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1])");
21 21
22 var offscreenCanvas2 = new OffscreenCanvas(width, height); 22 var offscreenCanvas2 = new OffscreenCanvas(width, height);
23 worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]); 23 worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]);
24 shouldThrow("offscreenCanvas2.transferToImageBitmap()"); 24 shouldThrow("offscreenCanvas2.transferToImageBitmap()");
25 25
26 shouldThrow("worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2])"); 26 shouldThrow("worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2])");
27 shouldThrow("offscreenCanvas2.getContext('2d')"); 27 shouldThrow("offscreenCanvas2.getContext('2d')");
28 28
29 // using a transferred OffscreenCanvas as a source image throws.
30 shouldThrow("ctx.drawImage(offscreenCanvas2, 0, 0)");
31
29 finishJSTest(); 32 finishJSTest();
30 </script> 33 </script>
31 </body> 34 </body>
32 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698