<canvas id="canvas" width="100" height="100"></canvas> | |
<script> | |
function runTest() { | |
if (window.testRunner) { | |
testRunner.waitUntilDone(); | |
testRunner.setBackingScaleFactor(2, function() { | |
var canvas = document.getElementById('canvas'); | |
var ctx = canvas.getContext('2d'); | |
ctx.fillStyle = '#0f0'; | |
ctx.fillRect(0, 0, 50, 40); | |
testRunner.notifyDone(); | |
}); | |
} | |
} | |
window.onload = runTest; | |
</script> |