https://github.com/web-platform-tests/wpt
Raw File
Tip revision: c050814c692c5e59194d4bf5b5d20f1bbf92397f authored by Simon Pieters on 19 December 2016, 13:33:32 UTC
Test that the snapshotting happens at document creation time
Tip revision: c050814
2d.transformation.rotate.wrapnegative.html
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.transformation.rotate.wrapnegative</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>

<h1>2d.transformation.rotate.wrapnegative</h1>
<p class="desc">rotate() wraps large negative values correctly</p>


<script>
var t = async_test("rotate() wraps large negative values correctly");
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 50);
ctx.rotate(-Math.PI * (1 + 4096));
ctx.fillStyle = '#0f0';
ctx.fillRect(-100, -50, 100, 50);
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
_assertPixel(offscreenCanvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255");
_assertPixel(offscreenCanvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255");

t.done();

});
</script>
back to top