OLD | NEW |
(Empty) | |
| 1 // DO NOT EDIT! This test has been generated by tools/gentest.py. |
| 2 // OffscreenCanvas test in a worker:2d.line.join.miter |
| 3 // Description:lineJoin 'miter' is rendered correctly |
| 4 // Note: |
| 5 |
| 6 importScripts("/resources/testharness.js"); |
| 7 importScripts("/common/canvas-tests.js"); |
| 8 |
| 9 var t = async_test("lineJoin 'miter' is rendered correctly"); |
| 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.lineJoin = 'miter'; |
| 18 ctx.lineWidth = 20; |
| 19 ctx.fillStyle = '#f00'; |
| 20 ctx.strokeStyle = '#0f0'; |
| 21 ctx.fillStyle = '#f00'; |
| 22 ctx.strokeStyle = '#0f0'; |
| 23 ctx.fillRect(10, 10, 30, 20); |
| 24 ctx.fillRect(20, 10, 20, 30); |
| 25 ctx.beginPath(); |
| 26 ctx.moveTo(10, 20); |
| 27 ctx.lineTo(30, 20); |
| 28 ctx.lineTo(30, 40); |
| 29 ctx.stroke(); |
| 30 ctx.fillStyle = '#0f0'; |
| 31 ctx.strokeStyle = '#f00'; |
| 32 ctx.beginPath(); |
| 33 ctx.moveTo(60, 20); |
| 34 ctx.lineTo(80, 20); |
| 35 ctx.lineTo(80, 40); |
| 36 ctx.stroke(); |
| 37 ctx.fillRect(60, 10, 30, 20); |
| 38 ctx.fillRect(70, 10, 20, 30); |
| 39 _assertPixel(offscreenCanvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); |
| 40 _assertPixel(offscreenCanvas, 39,11, 0,255,0,255, "39,11", "0,255,0,255"); |
| 41 _assertPixel(offscreenCanvas, 40,10, 0,255,0,255, "40,10", "0,255,0,255"); |
| 42 _assertPixel(offscreenCanvas, 41,9, 0,255,0,255, "41,9", "0,255,0,255"); |
| 43 _assertPixel(offscreenCanvas, 42,8, 0,255,0,255, "42,8", "0,255,0,255"); |
| 44 _assertPixel(offscreenCanvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); |
| 45 _assertPixel(offscreenCanvas, 89,11, 0,255,0,255, "89,11", "0,255,0,255"); |
| 46 _assertPixel(offscreenCanvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); |
| 47 _assertPixel(offscreenCanvas, 91,9, 0,255,0,255, "91,9", "0,255,0,255"); |
| 48 _assertPixel(offscreenCanvas, 92,8, 0,255,0,255, "92,8", "0,255,0,255"); |
| 49 |
| 50 t.done(); |
| 51 |
| 52 }); |
| 53 done(); |
OLD | NEW |