Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html |
| index 08a110f058efbf23cb8c92db7a70a54a817f1a87..5d078026f778cfa6c19aa3d3dec3b55090ea94c8 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html |
| @@ -1,16 +1,30 @@ |
| <!DOCTYPE html> |
| <html> |
| <body> |
| -<canvas id='output' width='100' height='100' style='background:red'></canvas> |
| - |
| +<canvas id='output1' width='100' height='100' style='background:red'></canvas> |
| +<canvas id='output2' width='100' height='100' style='background:blue'></canvas> |
|
Justin Novosad
2016/03/31 21:52:12
Just use red for all the backgrounds. Red is the u
|
| +<canvas id='output3' width='100' height='100' style='background:yellow'></canvas> |
| <script id='myWorker' type='text/worker'> |
| self.onmessage = function(e) { |
| var aCanvas = new OffscreenCanvas(100, 100); |
| var ctx = aCanvas.getContext('2d'); |
| ctx.fillStyle = 'green'; |
| ctx.fillRect(0, 0, 100, 100); |
| - var image = aCanvas.transferToImageBitmap(); |
| - self.postMessage(image, [image]); |
| + var image1 = aCanvas.transferToImageBitmap(); |
| + |
| + ctx.fillStyle = '#D359FE'; |
| + ctx.fillRect(0, 0, 100, 100); |
| + var image2 = aCanvas.transferToImageBitmap(); |
| + |
| + ctx.fillStyle = 'rgb(150,250,100)'; |
| + ctx.fillRect(0, 0, 100, 100); |
| + var image3 = aCanvas.transferToImageBitmap(); |
| + |
| + self.postMessage( |
| + { i1: image1, |
| + i2: image2, |
| + i3: image3 }, |
| + [ image1, image2, image3 ]); |
| }; |
| </script> |
| @@ -21,8 +35,13 @@ if (window.testRunner) { |
| var blob = new Blob([document.getElementById('myWorker').textContent]); |
| var worker = new Worker(URL.createObjectURL(blob)); |
| worker.addEventListener('message', msg => { |
| - var outputCtx = document.getElementById('output').getContext('imagebitmap'); |
| - outputCtx.transferImageBitmap(msg.data); |
| + var outputCtx1 = document.getElementById('output1').getContext('imagebitmap'); |
| + outputCtx1.transferImageBitmap(msg.data.i1); |
| + var outputCtx2 = document.getElementById('output2').getContext('imagebitmap'); |
| + outputCtx2.transferImageBitmap(msg.data.i2); |
| + var outputCtx3 = document.getElementById('output3').getContext('imagebitmap'); |
| + outputCtx3.transferImageBitmap(msg.data.i3); |
| + |
| if (window.testRunner) { |
| testRunner.notifyDone(); |
| } |