| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <script src="../../resources/testharness.js"></script> |
| 2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
| 3 <head> | 3 |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script> |
| 5 </head> | 5 test(function(t) { |
| 6 <body> | 6 var canvas = document.createElement('canvas'); |
| 7 <script src="script-tests/canvas-arc-connecting-line.js"></script> | 7 canvas.width = canvas.height = 300; |
| 8 </body> | 8 var ctx = canvas.getContext('2d'); |
| 9 </html> | 9 ctx.fillStyle = '#0f0'; |
| 10 ctx.fillRect(0, 0, canvas.width, canvas.height); |
| 11 ctx.lineJoin = 'bevel'; |
| 12 ctx.lineWidth = 12; |
| 13 ctx.beginPath(); |
| 14 ctx.arc(200, 50, 40, Math.PI / 2, -Math.PI / 2, false); |
| 15 ctx.arc(100, 50, 40, Math.PI / 2, -Math.PI / 2, false); |
| 16 ctx.stroke(); |
| 17 |
| 18 var imageData = ctx.getImageData(0, 0, 1, 1); |
| 19 var imgdata = imageData.data; |
| 20 assert_equals(imgdata[0], 0); |
| 21 assert_equals(imgdata[1], 255); |
| 22 assert_equals(imgdata[2], 0); |
| 23 |
| 24 imageData = ctx.getImageData(125, 30, 1, 1); |
| 25 imgdata = imageData.data; |
| 26 assert_equals(imgdata[0], 0); |
| 27 assert_equals(imgdata[1], 255); |
| 28 assert_equals(imgdata[2], 0); |
| 29 |
| 30 imageData = ctx.getImageData(125, 70, 1, 1); |
| 31 imgdata = imageData.data; |
| 32 assert_equals(imgdata[0], 0); |
| 33 assert_equals(imgdata[1], 0); |
| 34 assert_equals(imgdata[2], 0); |
| 35 }, 'Test that canvas arc()s are connected by a straight line. There should be tw
o C-shapes with a line from the bottom of the left one to the top of the right o
ne.'); |
| 36 </script> |
| OLD | NEW |