Browse Source

visual test

Signed-off-by: Tj Holowaychuk <tj@vision-media.ca>
v1.x
atomizer 14 years ago
committed by Tj Holowaychuk
parent
commit
cd3e9027d9
  1. 27
      test/public/tests.js

27
test/public/tests.js

@ -601,6 +601,33 @@ tests['states with stroke/fill/globalAlpha'] = function(ctx){
ctx.fillRect(60,60,30,30);
};
tests['path through fillRect/strokeRect/clearRect'] = function(ctx){
// left: fillRect()
ctx.beginPath();
ctx.rect(0, 50, 50, 50);
ctx.fillStyle = '#F00';
ctx.fillRect(10, 60, 30, 30);
ctx.fillStyle = '#0F0';
ctx.fill();
// center: strokeRect()
ctx.beginPath();
ctx.rect(50, 50, 50, 50);
ctx.strokeStyle = '#F00';
ctx.lineWidth = 5;
ctx.strokeRect(60, 60, 30, 30);
ctx.fillStyle = '#0F0';
ctx.fill();
// right: clearRect()
ctx.beginPath();
ctx.rect(100, 50, 50, 50);
ctx.fillStyle = '#0F0';
ctx.fill();
ctx.clearRect(110, 60, 30, 30);
ctx.fill();
}
tests['invalid stroke/fill styles'] = function(ctx){
ctx.fillStyle = 'red';
ctx.strokeStyle = 'yellow';

Loading…
Cancel
Save