OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <title>Ensure that globalAlpha is applied correctly to text.</title> |
3 <head> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 </head> | 5 |
6 <body> | 6 <script> |
7 <script src="script-tests/text-globalAlpha.js"></script> | 7 test(function() { |
8 </body> | 8 var canvas = document.createElement('canvas'); |
9 </html> | 9 var ctx = canvas.getContext('2d'); |
| 10 ctx.fillStyle = "black"; |
| 11 ctx.globalAlpha = 0.5; |
| 12 ctx.font = "50px Arial"; |
| 13 ctx.fillText("A",50,50); |
| 14 var imageData = ctx.getImageData(63, 22, 1, 1).data; |
| 15 var expectedValue = [127, 128]; |
| 16 assert_in_array(imageData[3], expectedValue); |
| 17 }); |
| 18 </script> |
OLD | NEW |