mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision 3137d1d2d7757366a69f8a449b458b5057e0e81e
This commit is contained in:
parent
81ca858678
commit
d6ba94ca28
2339 changed files with 89274 additions and 9328 deletions
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.angle.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.angle.1</h1>
|
||||
<p class="desc">arc() draws pi/2 .. -pi anticlockwise correctly</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws pi/2 .. -pi anticlockwise correctly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.angle.1
|
||||
// Description:arc() draws pi/2 .. -pi anticlockwise correctly
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws pi/2 .. -pi anticlockwise correctly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.angle.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.angle.2</h1>
|
||||
<p class="desc">arc() draws -3pi/2 .. -pi anticlockwise correctly</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws -3pi/2 .. -pi anticlockwise correctly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.angle.2
|
||||
// Description:arc() draws -3pi/2 .. -pi anticlockwise correctly
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws -3pi/2 .. -pi anticlockwise correctly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.angle.3</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.angle.3</h1>
|
||||
<p class="desc">arc() wraps angles mod 2pi when anticlockwise and end > start+2pi</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() wraps angles mod 2pi when anticlockwise and end > start+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.angle.3
|
||||
// Description:arc() wraps angles mod 2pi when anticlockwise and end > start+2pi
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() wraps angles mod 2pi when anticlockwise and end > start+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.angle.4</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.angle.4</h1>
|
||||
<p class="desc">arc() draws a full circle when clockwise and end > start+2pi</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws a full circle when clockwise and end > start+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,30 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.angle.4
|
||||
// Description:arc() draws a full circle when clockwise and end > start+2pi
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws a full circle when clockwise and end > start+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.angle.5</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.angle.5</h1>
|
||||
<p class="desc">arc() wraps angles mod 2pi when clockwise and start > end+2pi</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() wraps angles mod 2pi when clockwise and start > end+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.angle.5
|
||||
// Description:arc() wraps angles mod 2pi when clockwise and start > end+2pi
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() wraps angles mod 2pi when clockwise and start > end+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.angle.6</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.angle.6</h1>
|
||||
<p class="desc">arc() draws a full circle when anticlockwise and start > end+2pi</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws a full circle when anticlockwise and start > end+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,30 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.angle.6
|
||||
// Description:arc() draws a full circle when anticlockwise and start > end+2pi
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws a full circle when anticlockwise and start > end+2pi");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.default</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.default</h1>
|
||||
<p class="desc">arc() with missing last argument defaults to clockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with missing last argument defaults to clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, -Math.PI, Math.PI/2);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.default
|
||||
// Description:arc() with missing last argument defaults to clockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with missing last argument defaults to clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 0);
|
||||
ctx.arc(100, 0, 150, -Math.PI, Math.PI/2);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.empty</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.empty</h1>
|
||||
<p class="desc">arc() with an empty path does not draw a straight line to the start point</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with an empty path does not draw a straight line to the start point");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.empty
|
||||
// Description:arc() with an empty path does not draw a straight line to the start point
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with an empty path does not draw a straight line to the start point");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.end</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.end</h1>
|
||||
<p class="desc">arc() adds the end point of the arc to the subpath</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() adds the end point of the arc to the subpath");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 0);
|
||||
ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,29 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.end
|
||||
// Description:arc() adds the end point of the arc to the subpath
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() adds the end point of the arc to the subpath");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 0);
|
||||
ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.negative</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.negative</h1>
|
||||
<p class="desc">arc() with negative radius throws INDEX_SIZE_ERR</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with negative radius throws INDEX_SIZE_ERR");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.arc(0, 0, -1, 0, 0, true); });
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.negative
|
||||
// Description:arc() with negative radius throws INDEX_SIZE_ERR
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with negative radius throws INDEX_SIZE_ERR");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.arc(0, 0, -1, 0, 0, true); });
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.nonempty</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.nonempty</h1>
|
||||
<p class="desc">arc() with a non-empty path does draw a straight line to the start point</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with a non-empty path does draw a straight line to the start point");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.nonempty
|
||||
// Description:arc() with a non-empty path does draw a straight line to the start point
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with a non-empty path does draw a straight line to the start point");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.nonfinite</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.nonfinite</h1>
|
||||
<p class="desc">arc() with Infinity/NaN is ignored</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with Infinity/NaN is ignored");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, NaN, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, NaN, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, NaN, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, 0, Infinity, true);
|
||||
ctx.arc(0, 0, 50, 0, -Infinity, true);
|
||||
ctx.arc(0, 0, 50, 0, NaN, true);
|
||||
ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, 50, 0, Infinity, true);
|
||||
ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, 0, Infinity, 0, Infinity, true);
|
||||
ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, 50, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, 0, 50, 0, Infinity, true);
|
||||
ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(0, Infinity, Infinity, 0, Infinity, true);
|
||||
ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, 50, Infinity, Infinity, true);
|
||||
ctx.arc(0, Infinity, 50, 0, Infinity, true);
|
||||
ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(0, 0, Infinity, 0, Infinity, true);
|
||||
ctx.arc(0, 0, 50, Infinity, Infinity, true);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,70 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.nonfinite
|
||||
// Description:arc() with Infinity/NaN is ignored
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with Infinity/NaN is ignored");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, NaN, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, NaN, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, NaN, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, 50, 0, Infinity, true);
|
||||
ctx.arc(0, 0, 50, 0, -Infinity, true);
|
||||
ctx.arc(0, 0, 50, 0, NaN, true);
|
||||
ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, Infinity, 50, 0, Infinity, true);
|
||||
ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, 0, Infinity, 0, Infinity, true);
|
||||
ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(Infinity, 0, 50, Infinity, Infinity, true);
|
||||
ctx.arc(Infinity, 0, 50, 0, Infinity, true);
|
||||
ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(0, Infinity, Infinity, 0, Infinity, true);
|
||||
ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, Infinity, 50, Infinity, Infinity, true);
|
||||
ctx.arc(0, Infinity, 50, 0, Infinity, true);
|
||||
ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true);
|
||||
ctx.arc(0, 0, Infinity, Infinity, Infinity, true);
|
||||
ctx.arc(0, 0, Infinity, 0, Infinity, true);
|
||||
ctx.arc(0, 0, 50, Infinity, Infinity, true);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.scale.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.scale.1</h1>
|
||||
<p class="desc">Non-uniformly scaled arcs are the right shape</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Non-uniformly scaled arcs are the right shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(2, 0.5);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
|
||||
ctx.fill();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-25, 50);
|
||||
ctx.arc(-25, 50, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(75, 50);
|
||||
ctx.arc(75, 50, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(25, -25);
|
||||
ctx.arc(25, -25, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(25, 125);
|
||||
ctx.arc(25, 125, 24, 0, 2*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,46 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.scale.1
|
||||
// Description:Non-uniformly scaled arcs are the right shape
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("Non-uniformly scaled arcs are the right shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(2, 0.5);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
|
||||
ctx.fill();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-25, 50);
|
||||
ctx.arc(-25, 50, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(75, 50);
|
||||
ctx.arc(75, 50, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(25, -25);
|
||||
ctx.arc(25, -25, 24, 0, 2*Math.PI, false);
|
||||
ctx.moveTo(25, 125);
|
||||
ctx.arc(25, 125, 24, 0, 2*Math.PI, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.scale.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.scale.2</h1>
|
||||
<p class="desc">Highly scaled arcs are the right shape</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Highly scaled arcs are the right shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(100, 100);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 1.2;
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 0.6, 0, Math.PI/2, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,36 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.scale.2
|
||||
// Description:Highly scaled arcs are the right shape
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("Highly scaled arcs are the right shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.scale(100, 100);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 1.2;
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 0.6, 0, Math.PI/2, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.selfintersect.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.selfintersect.1</h1>
|
||||
<p class="desc">arc() with lineWidth > 2*radius is drawn sensibly</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with lineWidth > 2*radius is drawn sensibly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 200;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(100, 50, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,31 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.selfintersect.1
|
||||
// Description:arc() with lineWidth > 2*radius is drawn sensibly
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with lineWidth > 2*radius is drawn sensibly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 200;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(100, 50, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.selfintersect.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.selfintersect.2</h1>
|
||||
<p class="desc">arc() with lineWidth > 2*radius is drawn sensibly</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with lineWidth > 2*radius is drawn sensibly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 180;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-50, 50, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(100, 0, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,35 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.selfintersect.2
|
||||
// Description:arc() with lineWidth > 2*radius is drawn sensibly
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with lineWidth > 2*radius is drawn sensibly");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 180;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-50, 50, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.arc(100, 0, 25, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.shape.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.shape.1</h1>
|
||||
<p class="desc">arc() from 0 to pi does not draw anything in the wrong half</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() from 0 to pi does not draw anything in the wrong half");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 50, 50, 0, Math.PI, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.shape.1
|
||||
// Description:arc() from 0 to pi does not draw anything in the wrong half
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() from 0 to pi does not draw anything in the wrong half");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 50, 50, 0, Math.PI, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.shape.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.shape.2</h1>
|
||||
<p class="desc">arc() from 0 to pi draws stuff in the right half</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() from 0 to pi draws stuff in the right half");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 100;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 50, 50, 0, Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.shape.2
|
||||
// Description:arc() from 0 to pi draws stuff in the right half
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() from 0 to pi draws stuff in the right half");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 100;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 50, 50, 0, Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.shape.3</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.shape.3</h1>
|
||||
<p class="desc">arc() from 0 to -pi/2 does not draw anything in the wrong quadrant</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() from 0 to -pi/2 does not draw anything in the wrong quadrant");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 100;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 50, 50, 0, -Math.PI/2, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,31 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.shape.3
|
||||
// Description:arc() from 0 to -pi/2 does not draw anything in the wrong quadrant
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() from 0 to -pi/2 does not draw anything in the wrong quadrant");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 100;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 50, 50, 0, -Math.PI/2, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.shape.4</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.shape.4</h1>
|
||||
<p class="desc">arc() from 0 to -pi/2 draws stuff in the right quadrant</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() from 0 to -pi/2 draws stuff in the right quadrant");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 150;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-50, 50, 100, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,31 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.shape.4
|
||||
// Description:arc() from 0 to -pi/2 draws stuff in the right quadrant
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() from 0 to -pi/2 draws stuff in the right quadrant");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 150;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arc(-50, 50, 100, 0, -Math.PI/2, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.shape.5</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.shape.5</h1>
|
||||
<p class="desc">arc() from 0 to 5pi does not draw crazy things</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() from 0 to 5pi does not draw crazy things");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 200;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(300, 0, 100, 0, 5*Math.PI, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,31 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.shape.5
|
||||
// Description:arc() from 0 to 5pi does not draw crazy things
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() from 0 to 5pi does not draw crazy things");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 200;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arc(300, 0, 100, 0, 5*Math.PI, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.twopie.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.twopie.1</h1>
|
||||
<p class="desc">arc() draws nothing when end = start + 2pi-e and anticlockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws nothing when end = start + 2pi-e and anticlockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.twopie.1
|
||||
// Description:arc() draws nothing when end = start + 2pi-e and anticlockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws nothing when end = start + 2pi-e and anticlockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.twopie.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.twopie.2</h1>
|
||||
<p class="desc">arc() draws a full circle when end = start + 2pi-e and clockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws a full circle when end = start + 2pi-e and clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.twopie.2
|
||||
// Description:arc() draws a full circle when end = start + 2pi-e and clockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws a full circle when end = start + 2pi-e and clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.twopie.3</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.twopie.3</h1>
|
||||
<p class="desc">arc() draws a full circle when end = start + 2pi+e and anticlockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws a full circle when end = start + 2pi+e and anticlockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.twopie.3
|
||||
// Description:arc() draws a full circle when end = start + 2pi+e and anticlockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws a full circle when end = start + 2pi+e and anticlockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.twopie.4</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.twopie.4</h1>
|
||||
<p class="desc">arc() draws nothing when end = start + 2pi+e and clockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws nothing when end = start + 2pi+e and clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.twopie.4
|
||||
// Description:arc() draws nothing when end = start + 2pi+e and clockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws nothing when end = start + 2pi+e and clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.zero.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.zero.1</h1>
|
||||
<p class="desc">arc() draws nothing when startAngle = endAngle and anticlockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws nothing when startAngle = endAngle and anticlockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 0, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.zero.1
|
||||
// Description:arc() draws nothing when startAngle = endAngle and anticlockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws nothing when startAngle = endAngle and anticlockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 0, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.zero.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.zero.2</h1>
|
||||
<p class="desc">arc() draws nothing when startAngle = endAngle and clockwise</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() draws nothing when startAngle = endAngle and clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 0, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.zero.2
|
||||
// Description:arc() draws nothing when startAngle = endAngle and clockwise
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() draws nothing when startAngle = endAngle and clockwise");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 100;
|
||||
ctx.beginPath();
|
||||
ctx.arc(50, 25, 50, 0, 0, false);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arc.zeroradius</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arc.zeroradius</h1>
|
||||
<p class="desc">arc() with zero radius draws a line to the start point</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arc() with zero radius draws a line to the start point");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00'
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arc(200, 25, 0, 0, Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arc.zeroradius
|
||||
// Description:arc() with zero radius draws a line to the start point
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arc() with zero radius draws a line to the start point");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00'
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arc(200, 25, 0, 0, Math.PI, true);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.coincide.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.coincide.1</h1>
|
||||
<p class="desc">arcTo() has no effect if P0 = P1</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() has no effect if P0 = P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(0, 25, 50, 1000, 1);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arcTo(50, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,36 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.coincide.1
|
||||
// Description:arcTo() has no effect if P0 = P1
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() has no effect if P0 = P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(0, 25, 50, 1000, 1);
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(50, 25);
|
||||
ctx.arcTo(50, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.coincide.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.coincide.2</h1>
|
||||
<p class="desc">arcTo() draws a straight line to P1 if P1 = P2</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() draws a straight line to P1 if P1 = P2");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.coincide.2
|
||||
// Description:arcTo() draws a straight line to P1 if P1 = P2
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() draws a straight line to P1 if P1 = P2");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.collinear.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.collinear.1</h1>
|
||||
<p class="desc">arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 200, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.arcTo(0, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,33 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.collinear.1
|
||||
// Description:arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 200, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.arcTo(0, 25, 100, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.collinear.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.collinear.2</h1>
|
||||
<p class="desc">arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 10, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 110, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,33 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.collinear.2
|
||||
// Description:arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 10, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 110, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.collinear.3</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.collinear.3</h1>
|
||||
<p class="desc">arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, -100, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 0, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.arcTo(0, 25, -200, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,37 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.collinear.3
|
||||
// Description:arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, -100, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 0, 25, 1);
|
||||
ctx.stroke();
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, 25);
|
||||
ctx.arcTo(0, 25, -200, 25, 1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.ensuresubpath.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.ensuresubpath.1</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arcTo(100, 50, 200, 50, 0.1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,27 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.ensuresubpath.1
|
||||
// Description:If there is no subpath, the first control point is added (and nothing is drawn up to it)
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.arcTo(100, 50, 200, 50, 0.1);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.ensuresubpath.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.ensuresubpath.2</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("If there is no subpath, the first control point is added");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arcTo(0, 25, 50, 250, 0.1); // adds (x1,y1), draws nothing
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.ensuresubpath.2
|
||||
// Description:If there is no subpath, the first control point is added
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("If there is no subpath, the first control point is added");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.arcTo(0, 25, 50, 250, 0.1); // adds (x1,y1), draws nothing
|
||||
ctx.lineTo(100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.negative</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.negative</h1>
|
||||
<p class="desc">arcTo() with negative radius throws an exception</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with negative radius throws an exception");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.arcTo(0, 0, 0, 0, -1); });
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.negative
|
||||
// Description:arcTo() with negative radius throws an exception
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with negative radius throws an exception");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.arcTo(0, 0, 0, 0, -1); });
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.nonfinite</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.nonfinite</h1>
|
||||
<p class="desc">arcTo() with Infinity/NaN is ignored</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with Infinity/NaN is ignored");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.arcTo(Infinity, 50, 0, 50, 0);
|
||||
ctx.arcTo(-Infinity, 50, 0, 50, 0);
|
||||
ctx.arcTo(NaN, 50, 0, 50, 0);
|
||||
ctx.arcTo(0, Infinity, 0, 50, 0);
|
||||
ctx.arcTo(0, -Infinity, 0, 50, 0);
|
||||
ctx.arcTo(0, NaN, 0, 50, 0);
|
||||
ctx.arcTo(0, 50, Infinity, 50, 0);
|
||||
ctx.arcTo(0, 50, -Infinity, 50, 0);
|
||||
ctx.arcTo(0, 50, NaN, 50, 0);
|
||||
ctx.arcTo(0, 50, 0, Infinity, 0);
|
||||
ctx.arcTo(0, 50, 0, -Infinity, 0);
|
||||
ctx.arcTo(0, 50, 0, NaN, 0);
|
||||
ctx.arcTo(0, 50, 0, 50, Infinity);
|
||||
ctx.arcTo(0, 50, 0, 50, -Infinity);
|
||||
ctx.arcTo(0, 50, 0, 50, NaN);
|
||||
ctx.arcTo(Infinity, Infinity, 0, 50, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, 50, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, 0, Infinity, 0);
|
||||
ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, 0, 50, Infinity);
|
||||
ctx.arcTo(Infinity, 50, Infinity, 50, 0);
|
||||
ctx.arcTo(Infinity, 50, Infinity, Infinity, 0);
|
||||
ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, 50, Infinity, 50, Infinity);
|
||||
ctx.arcTo(Infinity, 50, 0, Infinity, 0);
|
||||
ctx.arcTo(Infinity, 50, 0, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, 50, 0, 50, Infinity);
|
||||
ctx.arcTo(0, Infinity, Infinity, 50, 0);
|
||||
ctx.arcTo(0, Infinity, Infinity, Infinity, 0);
|
||||
ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(0, Infinity, Infinity, 50, Infinity);
|
||||
ctx.arcTo(0, Infinity, 0, Infinity, 0);
|
||||
ctx.arcTo(0, Infinity, 0, Infinity, Infinity);
|
||||
ctx.arcTo(0, Infinity, 0, 50, Infinity);
|
||||
ctx.arcTo(0, 50, Infinity, Infinity, 0);
|
||||
ctx.arcTo(0, 50, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(0, 50, Infinity, 50, Infinity);
|
||||
ctx.arcTo(0, 50, 0, Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,68 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.nonfinite
|
||||
// Description:arcTo() with Infinity/NaN is ignored
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with Infinity/NaN is ignored");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.arcTo(Infinity, 50, 0, 50, 0);
|
||||
ctx.arcTo(-Infinity, 50, 0, 50, 0);
|
||||
ctx.arcTo(NaN, 50, 0, 50, 0);
|
||||
ctx.arcTo(0, Infinity, 0, 50, 0);
|
||||
ctx.arcTo(0, -Infinity, 0, 50, 0);
|
||||
ctx.arcTo(0, NaN, 0, 50, 0);
|
||||
ctx.arcTo(0, 50, Infinity, 50, 0);
|
||||
ctx.arcTo(0, 50, -Infinity, 50, 0);
|
||||
ctx.arcTo(0, 50, NaN, 50, 0);
|
||||
ctx.arcTo(0, 50, 0, Infinity, 0);
|
||||
ctx.arcTo(0, 50, 0, -Infinity, 0);
|
||||
ctx.arcTo(0, 50, 0, NaN, 0);
|
||||
ctx.arcTo(0, 50, 0, 50, Infinity);
|
||||
ctx.arcTo(0, 50, 0, 50, -Infinity);
|
||||
ctx.arcTo(0, 50, 0, 50, NaN);
|
||||
ctx.arcTo(Infinity, Infinity, 0, 50, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, 50, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, 0, Infinity, 0);
|
||||
ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, Infinity, 0, 50, Infinity);
|
||||
ctx.arcTo(Infinity, 50, Infinity, 50, 0);
|
||||
ctx.arcTo(Infinity, 50, Infinity, Infinity, 0);
|
||||
ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, 50, Infinity, 50, Infinity);
|
||||
ctx.arcTo(Infinity, 50, 0, Infinity, 0);
|
||||
ctx.arcTo(Infinity, 50, 0, Infinity, Infinity);
|
||||
ctx.arcTo(Infinity, 50, 0, 50, Infinity);
|
||||
ctx.arcTo(0, Infinity, Infinity, 50, 0);
|
||||
ctx.arcTo(0, Infinity, Infinity, Infinity, 0);
|
||||
ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(0, Infinity, Infinity, 50, Infinity);
|
||||
ctx.arcTo(0, Infinity, 0, Infinity, 0);
|
||||
ctx.arcTo(0, Infinity, 0, Infinity, Infinity);
|
||||
ctx.arcTo(0, Infinity, 0, 50, Infinity);
|
||||
ctx.arcTo(0, 50, Infinity, Infinity, 0);
|
||||
ctx.arcTo(0, 50, Infinity, Infinity, Infinity);
|
||||
ctx.arcTo(0, 50, Infinity, 50, Infinity);
|
||||
ctx.arcTo(0, 50, 0, Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.scale</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.scale</h1>
|
||||
<p class="desc">arcTo scales the curve, not just the control points</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo scales the curve, not just the control points");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.scale(0.1, 1);
|
||||
ctx.arcTo(50, 50, 50, 0, 50);
|
||||
ctx.lineTo(-1000, 0);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.scale
|
||||
// Description:arcTo scales the curve, not just the control points
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo scales the curve, not just the control points");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.scale(0.1, 1);
|
||||
ctx.arcTo(50, 50, 50, 0, 50);
|
||||
ctx.lineTo(-1000, 0);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.shape.curve1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.shape.curve1</h1>
|
||||
<p class="desc">arcTo() curves in the right kind of shape</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() curves in the right kind of shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
var tol = 1.5; // tolerance to avoid antialiasing artifacts
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(10, 25);
|
||||
ctx.arcTo(75, 25, 75, 60, 20);
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.rect(10, 20, 45, 10);
|
||||
ctx.moveTo(80, 45);
|
||||
ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true);
|
||||
ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,49 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.shape.curve1
|
||||
// Description:arcTo() curves in the right kind of shape
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() curves in the right kind of shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
var tol = 1.5; // tolerance to avoid antialiasing artifacts
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(10, 25);
|
||||
ctx.arcTo(75, 25, 75, 60, 20);
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.rect(10, 20, 45, 10);
|
||||
ctx.moveTo(80, 45);
|
||||
ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true);
|
||||
ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.shape.curve2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.shape.curve2</h1>
|
||||
<p class="desc">arcTo() curves in the right kind of shape</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() curves in the right kind of shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
var tol = 1.5; // tolerance to avoid antialiasing artifacts
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.rect(10, 20, 45, 10);
|
||||
ctx.moveTo(80, 45);
|
||||
ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true);
|
||||
ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false);
|
||||
ctx.fill();
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(10, 25);
|
||||
ctx.arcTo(75, 25, 75, 60, 20);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,48 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.shape.curve2
|
||||
// Description:arcTo() curves in the right kind of shape
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() curves in the right kind of shape");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
var tol = 1.5; // tolerance to avoid antialiasing artifacts
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.rect(10, 20, 45, 10);
|
||||
ctx.moveTo(80, 45);
|
||||
ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true);
|
||||
ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false);
|
||||
ctx.fill();
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 10;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(10, 25);
|
||||
ctx.arcTo(75, 25, 75, 60, 20);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.shape.end</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.shape.end</h1>
|
||||
<p class="desc">arcTo() does not draw anything from P1 to P2</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() does not draw anything from P1 to P2");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, -100);
|
||||
ctx.arcTo(-100, 25, 200, 25, 10);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.shape.end
|
||||
// Description:arcTo() does not draw anything from P1 to P2
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() does not draw anything from P1 to P2");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-100, -100);
|
||||
ctx.arcTo(-100, 25, 200, 25, 10);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.shape.start</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.shape.start</h1>
|
||||
<p class="desc">arcTo() draws a straight line from P0 to P1</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() draws a straight line from P0 to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(200, 25, 200, 50, 10);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.shape.start
|
||||
// Description:arcTo() draws a straight line from P0 to P1
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() draws a straight line from P0 to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(200, 25, 200, 50, 10);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.transformation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.transformation</h1>
|
||||
<p class="desc">arcTo joins up to the last subpath point correctly</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo joins up to the last subpath point 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.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.arcTo(50, 50, 50, 0, 50);
|
||||
ctx.lineTo(-100, 0);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,37 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.transformation
|
||||
// Description:arcTo joins up to the last subpath point correctly
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo joins up to the last subpath point 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.fillStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 50);
|
||||
ctx.translate(100, 0);
|
||||
ctx.arcTo(50, 50, 50, 0, 50);
|
||||
ctx.lineTo(-100, 0);
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.zero.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.zero.1</h1>
|
||||
<p class="desc">arcTo() with zero radius draws a straight line from P0 to P1</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with zero radius draws a straight line from P0 to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 100, 100, 0);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, -25);
|
||||
ctx.arcTo(50, -25, 50, 50, 0);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,33 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.zero.1
|
||||
// Description:arcTo() with zero radius draws a straight line from P0 to P1
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with zero radius draws a straight line from P0 to P1");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, 100, 100, 0);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, -25);
|
||||
ctx.arcTo(50, -25, 50, 50, 0);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.arcTo.zero.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.arcTo.zero.2</h1>
|
||||
<p class="desc">arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, -100, 25, 0);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 50, 25, 0);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,33 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.arcTo.zero.2
|
||||
// Description:arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.lineWidth = 50;
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.arcTo(100, 25, -100, 25, 0);
|
||||
ctx.stroke();
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, 25);
|
||||
ctx.arcTo(200, 25, 50, 25, 0);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.beginPath</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.beginPath</h1>
|
||||
<p class="desc"></p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.rect(0, 0, 100, 50);
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,26 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.beginPath
|
||||
// Description:
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.rect(0, 0, 100, 50);
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.bezierCurveTo.basic</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.bezierCurveTo.basic</h1>
|
||||
<p class="desc"></p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.bezierCurveTo(100, 25, 100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.basic
|
||||
// Description:
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 25);
|
||||
ctx.bezierCurveTo(100, 25, 100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.bezierCurveTo.ensuresubpath.1</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.bezierCurveTo.ensuresubpath.1</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.bezierCurveTo(100, 50, 200, 50, 200, 50);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.ensuresubpath.1
|
||||
// Description:If there is no subpath, the first control point is added (and nothing is drawn up to it)
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#f00';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.bezierCurveTo(100, 50, 200, 50, 200, 50);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.bezierCurveTo.ensuresubpath.2</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.bezierCurveTo.ensuresubpath.2</h1>
|
||||
<p class="desc">If there is no subpath, the first control point is added</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("If there is no subpath, the first control point is added");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.bezierCurveTo(0, 25, 100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,28 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.ensuresubpath.2
|
||||
// Description:If there is no subpath, the first control point is added
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("If there is no subpath, the first control point is added");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.strokeStyle = '#0f0';
|
||||
ctx.lineWidth = 50;
|
||||
ctx.beginPath();
|
||||
ctx.bezierCurveTo(0, 25, 100, 25, 100, 25);
|
||||
ctx.stroke();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,106 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.bezierCurveTo.nonfinite</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.bezierCurveTo.nonfinite</h1>
|
||||
<p class="desc">bezierCurveTo() with Infinity/NaN is ignored</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("bezierCurveTo() with Infinity/NaN is ignored");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,102 @@
|
|||
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.nonfinite
|
||||
// Description:bezierCurveTo() with Infinity/NaN is ignored
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/common/canvas-tests.js");
|
||||
|
||||
var t = async_test("bezierCurveTo() with Infinity/NaN is ignored");
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(100, 0);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity);
|
||||
ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity);
|
||||
ctx.lineTo(100, 50);
|
||||
ctx.lineTo(0, 50);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
|
||||
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue