blob: f431951af7813a2fa799f05bd2fde191767b050b [file] [log] [blame]
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<canvas id="mycanvas" width="512" height="512"></canvas>
<script>
function runTest() {
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
ctx.fillStyle = "rgb(255,165,0)";
ctx.fillRect(0, 0, 512, 512);
ctx.save();
canvas.width = 256;
ctx.fillStyle = "rgb(255,165,0)";
ctx.fillRect(0, 0, 256, 512);
}
async_test(t => {
window.onload = function() {
t.step(runTest);
t.done();
}
}, 'Verify that canvas resize after save does not crash.');
</script>
</body>