blob: 8f732f4f6afa59a94c7731ccea7b8377e1d9e3a3 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(function() {
var canvas = document.createElement('canvas');
canvas.width = canvas.height = 10;
var offscreen = canvas.transferControlToOffscreen();
var ctx = offscreen.getContext('2d');
ctx.fillStyle = '#ff0';
ctx.fillRect(0, 0, 10, 10);
var pixel = ctx.getImageData(0, 0, 1, 1).data;
assert_array_equals(pixel, [255, 255, 0, 255]);
}, "Verify that commit preserves the contents of an OffscreenCanvas with a 2d context.");
</script>