diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/canvas/offscreen/reset | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/canvas/offscreen/reset')
79 files changed, 2358 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html new file mode 100644 index 0000000000..7396ca120a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.basic</h1> +<p class="desc">reset clears to transparent black</p> + + +<script> +var t = async_test("reset clears to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height); + ctx.reset(); + _assertPixel(canvas, 0,0, 0,0,0,0); + _assertPixel(canvas, 50,25, 0,0,0,0); + _assertPixel(canvas, 25,50, 0,0,0,0); + _assertPixel(canvas, 100,50, 0,0,0,0); + _assertPixel(canvas, 0,50, 0,0,0,0); + _assertPixel(canvas, 100,0, 0,0,0,0); + t.done(); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js new file mode 100644 index 0000000000..180bffbfac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.basic +// Description:reset clears to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("reset clears to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height); + ctx.reset(); + _assertPixel(canvas, 0,0, 0,0,0,0); + _assertPixel(canvas, 50,25, 0,0,0,0); + _assertPixel(canvas, 25,50, 0,0,0,0); + _assertPixel(canvas, 100,50, 0,0,0,0); + _assertPixel(canvas, 0,50, 0,0,0,0); + _assertPixel(canvas, 100,0, 0,0,0,0); + t.done(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html new file mode 100644 index 0000000000..182f7e40cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.render.drop_shadow</title> +<h1>2d.reset.render.drop_shadow</h1> +<p class="desc">check that drop shadows are correctly rendered after reset</p> +<canvas id="canvas" width="500" height="500"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.fillRect(100, 100, 100, 100); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html new file mode 100644 index 0000000000..e6decd1687 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.render.drop_shadow-expected.html"> +<title>Canvas test: 2d.reset.render.drop_shadow</title> +<h1>2d.reset.render.drop_shadow</h1> +<p class="desc">check that drop shadows are correctly rendered after reset</p> +<canvas id="canvas" width="500" height="500"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(500, 500); + const ctx = canvas.getContext('2d'); + + ctx.shadowOffsetX = 10; + ctx.shadowOffsetY = 10; + ctx.shadowColor = "red"; + ctx.shadowBlur = 10; + + ctx.reset(); + + ctx.fillRect(100, 100, 100, 100); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html new file mode 100644 index 0000000000..0ceba2f91d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.render.drop_shadow-expected.html"> +<title>Canvas test: 2d.reset.render.drop_shadow</title> +<h1>2d.reset.render.drop_shadow</h1> +<p class="desc">check that drop shadows are correctly rendered after reset</p> +<canvas id="canvas" width="500" height="500"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(500, 500); + const ctx = canvas.getContext('2d'); + + ctx.shadowOffsetX = 10; + ctx.shadowOffsetY = 10; + ctx.shadowColor = "red"; + ctx.shadowBlur = 10; + + ctx.reset(); + + ctx.fillRect(100, 100, 100, 100); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html new file mode 100644 index 0000000000..1f9d247634 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.render.global_composite_operation</title> +<h1>2d.reset.render.global_composite_operation</h1> +<p class="desc">check that canvas correctly renders rectangles with the default global composite operation after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.fillRect(10, 10, 100, 100); + ctx.fillRect(50, 50, 100, 100); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html new file mode 100644 index 0000000000..4ddcc8d8f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.render.global_composite_operation-expected.html"> +<title>Canvas test: 2d.reset.render.global_composite_operation</title> +<h1>2d.reset.render.global_composite_operation</h1> +<p class="desc">check that canvas correctly renders rectangles with the default global composite operation after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = "xor"; + + ctx.reset(); + + ctx.fillRect(10, 10, 100, 100); + ctx.fillRect(50, 50, 100, 100); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html new file mode 100644 index 0000000000..6df07a47e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.render.global_composite_operation-expected.html"> +<title>Canvas test: 2d.reset.render.global_composite_operation</title> +<h1>2d.reset.render.global_composite_operation</h1> +<p class="desc">check that canvas correctly renders rectangles with the default global composite operation after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = "xor"; + + ctx.reset(); + + ctx.fillRect(10, 10, 100, 100); + ctx.fillRect(50, 50, 100, 100); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html new file mode 100644 index 0000000000..dcd648d8c3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.render.line</title> +<h1>2d.reset.render.line</h1> +<p class="desc">check that lines are correctly rendered after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.beginPath(); + ctx.moveTo(100, 100); + ctx.lineTo(100, 300); + ctx.lineTo(300, 300); + ctx.lineTo(300, 100); + ctx.stroke(); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html new file mode 100644 index 0000000000..0e478cbf9d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.render.line-expected.html"> +<title>Canvas test: 2d.reset.render.line</title> +<h1>2d.reset.render.line</h1> +<p class="desc">check that lines are correctly rendered after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.lineWidth = 10; + ctx.lineCap = "round"; + ctx.lineJoin = "bevel"; + ctx.lineDashOffset = 10; + ctx.setLineDash([20]); + + ctx.reset(); + + ctx.beginPath(); + ctx.moveTo(100, 100); + ctx.lineTo(100, 300); + ctx.lineTo(300, 300); + ctx.lineTo(300, 100); + ctx.stroke(); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html new file mode 100644 index 0000000000..e85f155b32 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.render.line-expected.html"> +<title>Canvas test: 2d.reset.render.line</title> +<h1>2d.reset.render.line</h1> +<p class="desc">check that lines are correctly rendered after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.lineWidth = 10; + ctx.lineCap = "round"; + ctx.lineJoin = "bevel"; + ctx.lineDashOffset = 10; + ctx.setLineDash([20]); + + ctx.reset(); + + ctx.beginPath(); + ctx.moveTo(100, 100); + ctx.lineTo(100, 300); + ctx.lineTo(300, 300); + ctx.lineTo(300, 100); + ctx.stroke(); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html new file mode 100644 index 0000000000..c359e6b42e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.render.misc</title> +<h1>2d.reset.render.misc</h1> +<p class="desc">check that canvas correctly renders rectangles after reset (states not covered by other tests)</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.fillRect(0, 0, 100, 100); + ctx.strokeRect(150, 150, 100, 100); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html new file mode 100644 index 0000000000..b471327d98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.render.misc-expected.html"> +<title>Canvas test: 2d.reset.render.misc</title> +<h1>2d.reset.render.misc</h1> +<p class="desc">check that canvas correctly renders rectangles after reset (states not covered by other tests)</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = "red"; + ctx.strokeStyle = "red"; + ctx.globalAlpha = 0.5; + ctx.filter = "blur(2px)"; + + ctx.reset(); + + ctx.fillRect(0, 0, 100, 100); + ctx.strokeRect(150, 150, 100, 100); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html new file mode 100644 index 0000000000..eef646df66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.render.misc-expected.html"> +<title>Canvas test: 2d.reset.render.misc</title> +<h1>2d.reset.render.misc</h1> +<p class="desc">check that canvas correctly renders rectangles after reset (states not covered by other tests)</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.fillStyle = "red"; + ctx.strokeStyle = "red"; + ctx.globalAlpha = 0.5; + ctx.filter = "blur(2px)"; + + ctx.reset(); + + ctx.fillRect(0, 0, 100, 100); + ctx.strokeRect(150, 150, 100, 100); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html new file mode 100644 index 0000000000..c91f485c53 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.render.miter_limit</title> +<h1>2d.reset.render.miter_limit</h1> +<p class="desc">check that the lines are correctly rendered with the default miter limit after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.lineWidth = 10; + + ctx.beginPath(); + ctx.moveTo(0, 100); + for (let i = 0; i < 24; i++) { + const dy = i % 2 === 0 ? 25 : -25; + ctx.lineTo(Math.pow(i, 1.5) * 2, 75 + dy); + } + ctx.stroke(); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html new file mode 100644 index 0000000000..c00284bbc2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.render.miter_limit-expected.html"> +<title>Canvas test: 2d.reset.render.miter_limit</title> +<h1>2d.reset.render.miter_limit</h1> +<p class="desc">check that the lines are correctly rendered with the default miter limit after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.miterLimit = 6; + + ctx.reset(); + + ctx.lineWidth = 10; + + ctx.beginPath(); + ctx.moveTo(0, 100); + for (let i = 0; i < 24; i++) { + const dy = i % 2 === 0 ? 25 : -25; + ctx.lineTo(Math.pow(i, 1.5) * 2, 75 + dy); + } + ctx.stroke(); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html new file mode 100644 index 0000000000..1f98606b55 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.render.miter_limit-expected.html"> +<title>Canvas test: 2d.reset.render.miter_limit</title> +<h1>2d.reset.render.miter_limit</h1> +<p class="desc">check that the lines are correctly rendered with the default miter limit after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.miterLimit = 6; + + ctx.reset(); + + ctx.lineWidth = 10; + + ctx.beginPath(); + ctx.moveTo(0, 100); + for (let i = 0; i < 24; i++) { + const dy = i % 2 === 0 ? 25 : -25; + ctx.lineTo(Math.pow(i, 1.5) * 2, 75 + dy); + } + ctx.stroke(); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html new file mode 100644 index 0000000000..7221483b02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.render.text</title> +<h1>2d.reset.render.text</h1> +<p class="desc">check that text is correctly rendered after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.fillText("Lorem ipsum dolor sit amet, consectetur adipiscing elit", 0, 10); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html new file mode 100644 index 0000000000..31e35db71c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.render.text-expected.html"> +<title>Canvas test: 2d.reset.render.text</title> +<h1>2d.reset.render.text</h1> +<p class="desc">check that text is correctly rendered after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.font = "24px serif"; + ctx.textAlign = "center"; + ctx.textBaseline = "hanging"; + ctx.direction = "rtl"; + ctx.letterSpacing = "10px"; + ctx.fontKerning = "none"; + ctx.fontStretch = "semi-condensed"; + ctx.fontVariantCaps = "tilting-caps"; + ctx.textRendering = "optimizeLegibility"; + ctx.wordSpacing = "20px"; + + ctx.reset(); + + ctx.fillText("Lorem ipsum dolor sit amet, consectetur adipiscing elit", 0, 10); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html new file mode 100644 index 0000000000..6ddfd9fd9d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.render.text-expected.html"> +<title>Canvas test: 2d.reset.render.text</title> +<h1>2d.reset.render.text</h1> +<p class="desc">check that text is correctly rendered after reset</p> +<canvas id="canvas" width="400" height="400"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(400, 400); + const ctx = canvas.getContext('2d'); + + ctx.font = "24px serif"; + ctx.textAlign = "center"; + ctx.textBaseline = "hanging"; + ctx.direction = "rtl"; + ctx.letterSpacing = "10px"; + ctx.fontKerning = "none"; + ctx.fontStretch = "semi-condensed"; + ctx.fontVariantCaps = "tilting-caps"; + ctx.textRendering = "optimizeLegibility"; + ctx.wordSpacing = "20px"; + + ctx.reset(); + + ctx.fillText("Lorem ipsum dolor sit amet, consectetur adipiscing elit", 0, 10); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html new file mode 100644 index 0000000000..974b37fab4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>Canvas test: 2d.reset.state.clip</title> +<h1>2d.reset.state.clip</h1> +<p class="desc">check that the clip is reset</p> +<canvas id="canvas" width="200" height="200"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = document.getElementById("canvas"); + const ctx = canvas.getContext('2d'); + + ctx.fillRect(0, 0, 200, 200); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html new file mode 100644 index 0000000000..2f53da7a49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<link rel="match" href="2d.reset.state.clip-expected.html"> +<title>Canvas test: 2d.reset.state.clip</title> +<h1>2d.reset.state.clip</h1> +<p class="desc">check that the clip is reset</p> +<canvas id="canvas" width="200" height="200"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script> + const canvas = new OffscreenCanvas(200, 200); + const ctx = canvas.getContext('2d'); + + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.clip(); + + ctx.fillRect(0, 0, 200, 200); + + ctx.reset(); + + ctx.fillRect(0, 0, 200, 200); + + const outputCanvas = document.getElementById("canvas"); + outputCanvas.getContext('2d').drawImage(canvas, 0, 0); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html new file mode 100644 index 0000000000..ec4bdf5b23 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<html class="reftest-wait"> +<link rel="match" href="2d.reset.state.clip-expected.html"> +<title>Canvas test: 2d.reset.state.clip</title> +<h1>2d.reset.state.clip</h1> +<p class="desc">check that the clip is reset</p> +<canvas id="canvas" width="200" height="200"> + <p class="fallback">FAIL (fallback content)</p> +</canvas> +<script id='myWorker' type='text/worker'> + self.onmessage = function(e) { + const canvas = new OffscreenCanvas(200, 200); + const ctx = canvas.getContext('2d'); + + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.clip(); + + ctx.fillRect(0, 0, 200, 200); + + ctx.reset(); + + ctx.fillRect(0, 0, 200, 200); + + const bitmap = canvas.transferToImageBitmap(); + self.postMessage(bitmap, bitmap); + }; +</script> +<script> + const blob = new Blob([document.getElementById('myWorker').textContent]); + const worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', msg => { + const outputCtx = document.getElementById("canvas").getContext('2d'); + outputCtx.drawImage(msg.data, 0, 0); + document.documentElement.classList.remove("reftest-wait"); + }); + worker.postMessage(null); +</script> +</html> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html new file mode 100644 index 0000000000..f2dc299e97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.direction</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.direction</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.direction; + + ctx.direction = 'rtl'; + _assert(ctx.direction == 'rtl', "ctx.direction == 'rtl'"); + + ctx.reset(); + _assert(ctx.direction == default_value, "ctx.direction == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js new file mode 100644 index 0000000000..3d6b835050 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.direction +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.direction; + + ctx.direction = 'rtl'; + _assert(ctx.direction == 'rtl', "ctx.direction == 'rtl'"); + + ctx.reset(); + _assert(ctx.direction == default_value, "ctx.direction == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html new file mode 100644 index 0000000000..1fdd2b773a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.fill_style</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.fill_style</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fillStyle; + + ctx.fillStyle = '#ffffff'; + _assert(ctx.fillStyle == '#ffffff', "ctx.fillStyle == '#ffffff'"); + + ctx.reset(); + _assert(ctx.fillStyle == default_value, "ctx.fillStyle == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js new file mode 100644 index 0000000000..c574824b0a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.fill_style +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fillStyle; + + ctx.fillStyle = '#ffffff'; + _assert(ctx.fillStyle == '#ffffff', "ctx.fillStyle == '#ffffff'"); + + ctx.reset(); + _assert(ctx.fillStyle == default_value, "ctx.fillStyle == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html new file mode 100644 index 0000000000..af898c7dd1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.filter</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.filter</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.filter; + + ctx.filter = 'blur(10px)'; + _assert(ctx.filter == 'blur(10px)', "ctx.filter == 'blur(10px)'"); + + ctx.reset(); + _assert(ctx.filter == default_value, "ctx.filter == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js new file mode 100644 index 0000000000..f781a9fa34 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.filter +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.filter; + + ctx.filter = 'blur(10px)'; + _assert(ctx.filter == 'blur(10px)', "ctx.filter == 'blur(10px)'"); + + ctx.reset(); + _assert(ctx.filter == default_value, "ctx.filter == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html new file mode 100644 index 0000000000..69bbf3261e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.font</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.font</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.font; + + ctx.font = '16px sans-serif'; + _assert(ctx.font == '16px sans-serif', "ctx.font == '16px sans-serif'"); + + ctx.reset(); + _assert(ctx.font == default_value, "ctx.font == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js new file mode 100644 index 0000000000..ea6f4cc184 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.font; + + ctx.font = '16px sans-serif'; + _assert(ctx.font == '16px sans-serif', "ctx.font == '16px sans-serif'"); + + ctx.reset(); + _assert(ctx.font == default_value, "ctx.font == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html new file mode 100644 index 0000000000..27954486c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.font_kerning</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.font_kerning</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontKerning; + + ctx.fontKerning = 'normal'; + _assert(ctx.fontKerning == 'normal', "ctx.fontKerning == 'normal'"); + + ctx.reset(); + _assert(ctx.fontKerning == default_value, "ctx.fontKerning == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js new file mode 100644 index 0000000000..1c21249b9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font_kerning +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontKerning; + + ctx.fontKerning = 'normal'; + _assert(ctx.fontKerning == 'normal', "ctx.fontKerning == 'normal'"); + + ctx.reset(); + _assert(ctx.fontKerning == default_value, "ctx.fontKerning == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html new file mode 100644 index 0000000000..b1e2217320 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.font_stretch</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.font_stretch</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontStretch; + + ctx.fontStretch = 'ultra-condensed'; + _assert(ctx.fontStretch == 'ultra-condensed', "ctx.fontStretch == 'ultra-condensed'"); + + ctx.reset(); + _assert(ctx.fontStretch == default_value, "ctx.fontStretch == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js new file mode 100644 index 0000000000..71bb6aff48 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font_stretch +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontStretch; + + ctx.fontStretch = 'ultra-condensed'; + _assert(ctx.fontStretch == 'ultra-condensed', "ctx.fontStretch == 'ultra-condensed'"); + + ctx.reset(); + _assert(ctx.fontStretch == default_value, "ctx.fontStretch == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html new file mode 100644 index 0000000000..7d0518c021 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.font_variant_caps</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.font_variant_caps</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontVariantCaps; + + ctx.fontVariantCaps = 'unicase'; + _assert(ctx.fontVariantCaps == 'unicase', "ctx.fontVariantCaps == 'unicase'"); + + ctx.reset(); + _assert(ctx.fontVariantCaps == default_value, "ctx.fontVariantCaps == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js new file mode 100644 index 0000000000..e89a8bda42 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font_variant_caps +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontVariantCaps; + + ctx.fontVariantCaps = 'unicase'; + _assert(ctx.fontVariantCaps == 'unicase', "ctx.fontVariantCaps == 'unicase'"); + + ctx.reset(); + _assert(ctx.fontVariantCaps == default_value, "ctx.fontVariantCaps == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html new file mode 100644 index 0000000000..fe87aedf84 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.global_alpha</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.global_alpha</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.globalAlpha; + + ctx.globalAlpha = 0.5; + _assert(ctx.globalAlpha == 0.5, "ctx.globalAlpha == 0.5"); + + ctx.reset(); + _assert(ctx.globalAlpha == default_value, "ctx.globalAlpha == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js new file mode 100644 index 0000000000..518a8cbb46 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.global_alpha +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.globalAlpha; + + ctx.globalAlpha = 0.5; + _assert(ctx.globalAlpha == 0.5, "ctx.globalAlpha == 0.5"); + + ctx.reset(); + _assert(ctx.globalAlpha == default_value, "ctx.globalAlpha == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html new file mode 100644 index 0000000000..647349c94a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.global_composite_operation</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.global_composite_operation</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.globalCompositeOperation; + + ctx.globalCompositeOperation = 'destination-over'; + _assert(ctx.globalCompositeOperation == 'destination-over', "ctx.globalCompositeOperation == 'destination-over'"); + + ctx.reset(); + _assert(ctx.globalCompositeOperation == default_value, "ctx.globalCompositeOperation == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js new file mode 100644 index 0000000000..c94f15b232 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.global_composite_operation +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.globalCompositeOperation; + + ctx.globalCompositeOperation = 'destination-over'; + _assert(ctx.globalCompositeOperation == 'destination-over', "ctx.globalCompositeOperation == 'destination-over'"); + + ctx.reset(); + _assert(ctx.globalCompositeOperation == default_value, "ctx.globalCompositeOperation == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html new file mode 100644 index 0000000000..c0b7f29aca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.image_smoothing_enabled</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.image_smoothing_enabled</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.imageSmoothingEnabled; + + ctx.imageSmoothingEnabled = false; + _assert(ctx.imageSmoothingEnabled == false, "ctx.imageSmoothingEnabled == false"); + + ctx.reset(); + _assert(ctx.imageSmoothingEnabled == default_value, "ctx.imageSmoothingEnabled == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js new file mode 100644 index 0000000000..7010fb899c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.image_smoothing_enabled +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.imageSmoothingEnabled; + + ctx.imageSmoothingEnabled = false; + _assert(ctx.imageSmoothingEnabled == false, "ctx.imageSmoothingEnabled == false"); + + ctx.reset(); + _assert(ctx.imageSmoothingEnabled == default_value, "ctx.imageSmoothingEnabled == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html new file mode 100644 index 0000000000..12a6367ff9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.image_smoothing_quality</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.image_smoothing_quality</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.imageSmoothingQuality; + + ctx.imageSmoothingQuality = 'high'; + _assert(ctx.imageSmoothingQuality == 'high', "ctx.imageSmoothingQuality == 'high'"); + + ctx.reset(); + _assert(ctx.imageSmoothingQuality == default_value, "ctx.imageSmoothingQuality == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js new file mode 100644 index 0000000000..7429666691 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.image_smoothing_quality +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.imageSmoothingQuality; + + ctx.imageSmoothingQuality = 'high'; + _assert(ctx.imageSmoothingQuality == 'high', "ctx.imageSmoothingQuality == 'high'"); + + ctx.reset(); + _assert(ctx.imageSmoothingQuality == default_value, "ctx.imageSmoothingQuality == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html new file mode 100644 index 0000000000..addb0c62ad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.letter_spacing</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.letter_spacing</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.letterSpacing; + + ctx.letterSpacing = '12px'; + _assert(ctx.letterSpacing == '12px', "ctx.letterSpacing == '12px'"); + + ctx.reset(); + _assert(ctx.letterSpacing == default_value, "ctx.letterSpacing == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js new file mode 100644 index 0000000000..e0dfae0a8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.letter_spacing +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.letterSpacing; + + ctx.letterSpacing = '12px'; + _assert(ctx.letterSpacing == '12px', "ctx.letterSpacing == '12px'"); + + ctx.reset(); + _assert(ctx.letterSpacing == default_value, "ctx.letterSpacing == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html new file mode 100644 index 0000000000..9b528b3448 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.line_cap</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.line_cap</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineCap; + + ctx.lineCap = 'square'; + _assert(ctx.lineCap == 'square', "ctx.lineCap == 'square'"); + + ctx.reset(); + _assert(ctx.lineCap == default_value, "ctx.lineCap == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js new file mode 100644 index 0000000000..c3a94f2cbb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_cap +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineCap; + + ctx.lineCap = 'square'; + _assert(ctx.lineCap == 'square', "ctx.lineCap == 'square'"); + + ctx.reset(); + _assert(ctx.lineCap == default_value, "ctx.lineCap == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html new file mode 100644 index 0000000000..fd4edf58cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.line_dash</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.line_dash</h1> +<p class="desc">check that the line dash is reset</p> + + +<script> +var t = async_test("check that the line dash is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.setLineDash([1, 2]); + + ctx.reset(); + _assert(ctx.getLineDash().length == 0, "ctx.getLineDash().length == 0"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js new file mode 100644 index 0000000000..841475d876 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_dash +// Description:check that the line dash is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the line dash is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.setLineDash([1, 2]); + + ctx.reset(); + _assert(ctx.getLineDash().length == 0, "ctx.getLineDash().length == 0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html new file mode 100644 index 0000000000..475db49f82 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.line_dash_offset</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.line_dash_offset</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineDashOffset; + + ctx.lineDashOffset = 1.0; + _assert(ctx.lineDashOffset == 1.0, "ctx.lineDashOffset == 1.0"); + + ctx.reset(); + _assert(ctx.lineDashOffset == default_value, "ctx.lineDashOffset == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js new file mode 100644 index 0000000000..5e0d8dd47c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_dash_offset +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineDashOffset; + + ctx.lineDashOffset = 1.0; + _assert(ctx.lineDashOffset == 1.0, "ctx.lineDashOffset == 1.0"); + + ctx.reset(); + _assert(ctx.lineDashOffset == default_value, "ctx.lineDashOffset == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html new file mode 100644 index 0000000000..793c1d9bc4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.line_join</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.line_join</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineJoin; + + ctx.lineJoin = 'bevel'; + _assert(ctx.lineJoin == 'bevel', "ctx.lineJoin == 'bevel'"); + + ctx.reset(); + _assert(ctx.lineJoin == default_value, "ctx.lineJoin == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js new file mode 100644 index 0000000000..9d5e76757b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_join +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineJoin; + + ctx.lineJoin = 'bevel'; + _assert(ctx.lineJoin == 'bevel', "ctx.lineJoin == 'bevel'"); + + ctx.reset(); + _assert(ctx.lineJoin == default_value, "ctx.lineJoin == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html new file mode 100644 index 0000000000..8cdf45f700 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.line_width</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.line_width</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineWidth; + + ctx.lineWidth = 1; + _assert(ctx.lineWidth == 1, "ctx.lineWidth == 1"); + + ctx.reset(); + _assert(ctx.lineWidth == default_value, "ctx.lineWidth == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js new file mode 100644 index 0000000000..1e28f93d66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_width +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineWidth; + + ctx.lineWidth = 1; + _assert(ctx.lineWidth == 1, "ctx.lineWidth == 1"); + + ctx.reset(); + _assert(ctx.lineWidth == default_value, "ctx.lineWidth == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html new file mode 100644 index 0000000000..7f47f9a6be --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.miter_limit</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.miter_limit</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.miterLimit; + + ctx.miterLimit = 1.0; + _assert(ctx.miterLimit == 1.0, "ctx.miterLimit == 1.0"); + + ctx.reset(); + _assert(ctx.miterLimit == default_value, "ctx.miterLimit == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js new file mode 100644 index 0000000000..3945a662d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.miter_limit +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.miterLimit; + + ctx.miterLimit = 1.0; + _assert(ctx.miterLimit == 1.0, "ctx.miterLimit == 1.0"); + + ctx.reset(); + _assert(ctx.miterLimit == default_value, "ctx.miterLimit == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html new file mode 100644 index 0000000000..e7075ce102 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.shadow_blur</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.shadow_blur</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowBlur; + + ctx.shadowBlur = 10.0; + _assert(ctx.shadowBlur == 10.0, "ctx.shadowBlur == 10.0"); + + ctx.reset(); + _assert(ctx.shadowBlur == default_value, "ctx.shadowBlur == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js new file mode 100644 index 0000000000..d82933169d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_blur +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowBlur; + + ctx.shadowBlur = 10.0; + _assert(ctx.shadowBlur == 10.0, "ctx.shadowBlur == 10.0"); + + ctx.reset(); + _assert(ctx.shadowBlur == default_value, "ctx.shadowBlur == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html new file mode 100644 index 0000000000..ad928acf46 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.shadow_color</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.shadow_color</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowColor; + + ctx.shadowColor = '#ff0000'; + _assert(ctx.shadowColor == '#ff0000', "ctx.shadowColor == '#ff0000'"); + + ctx.reset(); + _assert(ctx.shadowColor == default_value, "ctx.shadowColor == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js new file mode 100644 index 0000000000..6ad1e83be2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_color +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowColor; + + ctx.shadowColor = '#ff0000'; + _assert(ctx.shadowColor == '#ff0000', "ctx.shadowColor == '#ff0000'"); + + ctx.reset(); + _assert(ctx.shadowColor == default_value, "ctx.shadowColor == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html new file mode 100644 index 0000000000..e3742e4dbc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.shadow_offset_x</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.shadow_offset_x</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowOffsetX; + + ctx.shadowOffsetX = 10.0; + _assert(ctx.shadowOffsetX == 10.0, "ctx.shadowOffsetX == 10.0"); + + ctx.reset(); + _assert(ctx.shadowOffsetX == default_value, "ctx.shadowOffsetX == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js new file mode 100644 index 0000000000..4247820a4d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_offset_x +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowOffsetX; + + ctx.shadowOffsetX = 10.0; + _assert(ctx.shadowOffsetX == 10.0, "ctx.shadowOffsetX == 10.0"); + + ctx.reset(); + _assert(ctx.shadowOffsetX == default_value, "ctx.shadowOffsetX == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html new file mode 100644 index 0000000000..64901ef492 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.shadow_offset_y</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.shadow_offset_y</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowOffsetY; + + ctx.shadowOffsetY = 10.0; + _assert(ctx.shadowOffsetY == 10.0, "ctx.shadowOffsetY == 10.0"); + + ctx.reset(); + _assert(ctx.shadowOffsetY == default_value, "ctx.shadowOffsetY == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js new file mode 100644 index 0000000000..0c1926ebca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_offset_y +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowOffsetY; + + ctx.shadowOffsetY = 10.0; + _assert(ctx.shadowOffsetY == 10.0, "ctx.shadowOffsetY == 10.0"); + + ctx.reset(); + _assert(ctx.shadowOffsetY == default_value, "ctx.shadowOffsetY == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html new file mode 100644 index 0000000000..79803b2828 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.stroke_style</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.stroke_style</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.strokeStyle; + + ctx.strokeStyle = '#ffffff'; + _assert(ctx.strokeStyle == '#ffffff', "ctx.strokeStyle == '#ffffff'"); + + ctx.reset(); + _assert(ctx.strokeStyle == default_value, "ctx.strokeStyle == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js new file mode 100644 index 0000000000..99e1eaaed5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.stroke_style +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.strokeStyle; + + ctx.strokeStyle = '#ffffff'; + _assert(ctx.strokeStyle == '#ffffff', "ctx.strokeStyle == '#ffffff'"); + + ctx.reset(); + _assert(ctx.strokeStyle == default_value, "ctx.strokeStyle == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html new file mode 100644 index 0000000000..c1a33d6f3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.text_align</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.text_align</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textAlign; + + ctx.textAlign = 'end'; + _assert(ctx.textAlign == 'end', "ctx.textAlign == 'end'"); + + ctx.reset(); + _assert(ctx.textAlign == default_value, "ctx.textAlign == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js new file mode 100644 index 0000000000..087d3195e4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.text_align +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textAlign; + + ctx.textAlign = 'end'; + _assert(ctx.textAlign == 'end', "ctx.textAlign == 'end'"); + + ctx.reset(); + _assert(ctx.textAlign == default_value, "ctx.textAlign == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html new file mode 100644 index 0000000000..acb56e4a00 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.text_baseline</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.text_baseline</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textBaseline; + + ctx.textBaseline = 'middle'; + _assert(ctx.textBaseline == 'middle', "ctx.textBaseline == 'middle'"); + + ctx.reset(); + _assert(ctx.textBaseline == default_value, "ctx.textBaseline == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js new file mode 100644 index 0000000000..9a171326cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.text_baseline +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textBaseline; + + ctx.textBaseline = 'middle'; + _assert(ctx.textBaseline == 'middle', "ctx.textBaseline == 'middle'"); + + ctx.reset(); + _assert(ctx.textBaseline == default_value, "ctx.textBaseline == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html new file mode 100644 index 0000000000..174dbb3801 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.text_rendering</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.text_rendering</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textRendering; + + ctx.textRendering = 'geometricPrecision'; + _assert(ctx.textRendering == 'geometricPrecision', "ctx.textRendering == 'geometricPrecision'"); + + ctx.reset(); + _assert(ctx.textRendering == default_value, "ctx.textRendering == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js new file mode 100644 index 0000000000..df4cea1044 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.text_rendering +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textRendering; + + ctx.textRendering = 'geometricPrecision'; + _assert(ctx.textRendering == 'geometricPrecision', "ctx.textRendering == 'geometricPrecision'"); + + ctx.reset(); + _assert(ctx.textRendering == default_value, "ctx.textRendering == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html new file mode 100644 index 0000000000..c30e459b30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.transformation_matrix</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.transformation_matrix</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.scale(2, 2); + + ctx.reset(); + _assert(ctx.getTransform().isIdentity, "ctx.getTransform().isIdentity"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js new file mode 100644 index 0000000000..2ae105c20e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.transformation_matrix +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.scale(2, 2); + + ctx.reset(); + _assert(ctx.getTransform().isIdentity, "ctx.getTransform().isIdentity"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html new file mode 100644 index 0000000000..470db2cf98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: 2d.reset.state.word_spacing</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>2d.reset.state.word_spacing</h1> +<p class="desc">check that the state is reset</p> + + +<script> +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.wordSpacing; + + ctx.wordSpacing = '12px'; + _assert(ctx.wordSpacing == '12px', "ctx.wordSpacing == '12px'"); + + ctx.reset(); + _assert(ctx.wordSpacing == default_value, "ctx.wordSpacing == default_value"); + t.done(); + +}); +</script> diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js new file mode 100644 index 0000000000..9e8c717f78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.word_spacing +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.wordSpacing; + + ctx.wordSpacing = '12px'; + _assert(ctx.wordSpacing == '12px', "ctx.wordSpacing == '12px'"); + + ctx.reset(); + _assert(ctx.wordSpacing == default_value, "ctx.wordSpacing == default_value"); + t.done(); +}); +done(); |