Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/resources/canvas-ImageBitmap-transferable.js |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/resources/canvas-ImageBitmap-transferable.js b/third_party/WebKit/LayoutTests/fast/canvas/resources/canvas-ImageBitmap-transferable.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2e700a95bf7c0da9268ebf4ad0573cbf3f62c6ed |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/resources/canvas-ImageBitmap-transferable.js |
| @@ -0,0 +1,11 @@ |
| +self.onmessage = function(e) { |
| + // Worker does two things: |
| + // 1. call createImageBitmap() from the ImageBitmap that is transfered |
| + // from the main thread |
|
Justin Novosad
2015/10/23 13:30:04
Explain why. I imagine it is to get test coverage
|
| + // 2. send the created ImageBitmap back to the main thread, the |
| + // main thread exam the property of this ImageBitmap to make sure |
| + // the transfer between main and worker thread didn't lose data |
| + createImageBitmap(e.data.data).then(imageBitmap => { |
| + postMessage({data: imageBitmap}, [imageBitmap]); |
| + }); |
| +}; |