Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/imagebitmap/transferImageBitmap.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/imagebitmap/transferImageBitmap.html b/third_party/WebKit/LayoutTests/fast/canvas/imagebitmap/transferImageBitmap.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7f0a8478fd9f2817ca3e51423f18bdb82ee7bbd6 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/imagebitmap/transferImageBitmap.html |
| @@ -0,0 +1,22 @@ |
| +<!DOCTYPE html> |
| +<canvas id = 'dstCanvas' width='100' height='100'></canvas> |
| +<script> |
| +if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
|
Stephen White
2016/02/10 15:34:55
Nit: weird indentation here.
Justin Novosad
2016/02/10 15:50:21
Hah, looks like the presubmit check don't check fo
|
| +} |
| +var srcCanvas = document.createElement('canvas'); |
| +srcCanvas.width = srcCanvas.height = 100; |
| +var ctx = srcCanvas.getContext('2d'); |
| +ctx.fillStyle = 'green'; |
| +ctx.fillRect(0, 0, 100, 100); |
| +createImageBitmap(srcCanvas).then(consumeImageBitmap) |
| + |
| +function consumeImageBitmap(image) { |
| + var dstCanvas = document.getElementById('dstCanvas'); |
|
Stephen White
2016/02/10 15:34:55
Nit: weird indentation here.
|
| + var dstCtx = dstCanvas.getContext('imagebitmap'); |
| + dstCtx.transferImageBitmap(image); |
| + if (window.testRunner) { |
| + testRunner.notifyDone(); |
| + } |
| +} |
| +</script> |