OLD | NEW |
(Empty) | |
| 1 // DO NOT EDIT! This test has been generated by tools/gentest.py. |
| 2 // OffscreenCanvas test in a worker:2d.shadow.stroke.join.1 |
| 3 // Description:Shadows are not drawn for areas outside stroke joins |
| 4 // Note: |
| 5 |
| 6 importScripts("/resources/testharness.js"); |
| 7 importScripts("/common/canvas-tests.js"); |
| 8 |
| 9 var t = async_test("Shadows are not drawn for areas outside stroke joins"); |
| 10 t.step(function() { |
| 11 |
| 12 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 13 var ctx = offscreenCanvas.getContext('2d'); |
| 14 |
| 15 ctx.fillStyle = '#0f0'; |
| 16 ctx.fillRect(0, 0, 100, 50); |
| 17 ctx.strokeStyle = '#f00'; |
| 18 ctx.shadowColor = '#f00'; |
| 19 ctx.shadowOffsetX = 100; |
| 20 ctx.lineWidth = 200; |
| 21 ctx.lineJoin = 'bevel'; |
| 22 ctx.beginPath(); |
| 23 ctx.moveTo(-200, -50); |
| 24 ctx.lineTo(-150, -50); |
| 25 ctx.lineTo(-151, -100); |
| 26 ctx.stroke(); |
| 27 _assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); |
| 28 _assertPixel(offscreenCanvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); |
| 29 _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); |
| 30 _assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); |
| 31 |
| 32 t.done(); |
| 33 |
| 34 }); |
| 35 done(); |
OLD | NEW |