diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/2dcontext/conformance-requirements | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/2dcontext/conformance-requirements')
6 files changed, 268 insertions, 0 deletions
diff --git a/testing/web-platform/tests/2dcontext/conformance-requirements/.gitkeep b/testing/web-platform/tests/2dcontext/conformance-requirements/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/conformance-requirements/.gitkeep diff --git a/testing/web-platform/tests/2dcontext/conformance-requirements/2d.coordinatespace-manual.html b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.coordinatespace-manual.html new file mode 100644 index 000000000..ba925df1b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.coordinatespace-manual.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.coordinatespace</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.coordinatespace</h1> +<p class="desc">Coordinate space goes from top-left to bottom-right</p> + +<p class="notes">This should not be upside down. +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.coordinatespace.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Coordinate space goes from top-left to bottom-right"); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0ff'; +ctx.fillRect(0, 0, 50, 25); +_assertPixel(canvas, 25,12, 0,255,255,255, "25,12", "0,255,255,255"); +_assertPixel(canvas, 75,12, 0,0,255,255, "75,12", "0,0,255,255"); +_assertPixel(canvas, 25,37, 0,0,255,255, "25,37", "0,0,255,255"); +_assertPixel(canvas, 75,37, 0,0,255,255, "75,37", "0,0,255,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/conformance-requirements/2d.coordinatespace.png b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.coordinatespace.png Binary files differnew file mode 100644 index 000000000..8f8705c14 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.coordinatespace.png diff --git a/testing/web-platform/tests/2dcontext/conformance-requirements/2d.missingargs.html b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.missingargs.html new file mode 100644 index 000000000..2c89cf2ac --- /dev/null +++ b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.missingargs.html @@ -0,0 +1,142 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.missingargs</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.missingargs</h1> +<p class="desc">Missing arguments cause TypeError</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("Missing arguments cause TypeError"); +_addTest(function(canvas, ctx) { + +assert_throws(new TypeError(), function() { ctx.scale(); }); +assert_throws(new TypeError(), function() { ctx.scale(1); }); +assert_throws(new TypeError(), function() { ctx.rotate(); }); +assert_throws(new TypeError(), function() { ctx.translate(); }); +assert_throws(new TypeError(), function() { ctx.translate(0); }); +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + assert_throws(new TypeError(), function() { ctx.transform(); }); + assert_throws(new TypeError(), function() { ctx.transform(1); }); + assert_throws(new TypeError(), function() { ctx.transform(1, 0); }); + assert_throws(new TypeError(), function() { ctx.transform(1, 0, 0); }); + assert_throws(new TypeError(), function() { ctx.transform(1, 0, 0, 1); }); + assert_throws(new TypeError(), function() { ctx.transform(1, 0, 0, 1, 0); }); +} +if (ctx.setTransform) { + assert_throws(new TypeError(), function() { ctx.setTransform(); }); + assert_throws(new TypeError(), function() { ctx.setTransform(1); }); + assert_throws(new TypeError(), function() { ctx.setTransform(1, 0); }); + assert_throws(new TypeError(), function() { ctx.setTransform(1, 0, 0); }); + assert_throws(new TypeError(), function() { ctx.setTransform(1, 0, 0, 1); }); + assert_throws(new TypeError(), function() { ctx.setTransform(1, 0, 0, 1, 0); }); +} +assert_throws(new TypeError(), function() { ctx.createLinearGradient(); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.createPattern(canvas); }); +assert_throws(new TypeError(), function() { ctx.clearRect(); }); +assert_throws(new TypeError(), function() { ctx.clearRect(0); }); +assert_throws(new TypeError(), function() { ctx.clearRect(0, 0); }); +assert_throws(new TypeError(), function() { ctx.clearRect(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.fillRect(); }); +assert_throws(new TypeError(), function() { ctx.fillRect(0); }); +assert_throws(new TypeError(), function() { ctx.fillRect(0, 0); }); +assert_throws(new TypeError(), function() { ctx.fillRect(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.strokeRect(); }); +assert_throws(new TypeError(), function() { ctx.strokeRect(0); }); +assert_throws(new TypeError(), function() { ctx.strokeRect(0, 0); }); +assert_throws(new TypeError(), function() { ctx.strokeRect(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.moveTo(); }); +assert_throws(new TypeError(), function() { ctx.moveTo(0); }); +assert_throws(new TypeError(), function() { ctx.lineTo(); }); +assert_throws(new TypeError(), function() { ctx.lineTo(0); }); +assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(); }); +assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(0); }); +assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(0, 0); }); +assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.bezierCurveTo(); }); +assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0); }); +assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0); }); +assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0, 0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.arcTo(); }); +assert_throws(new TypeError(), function() { ctx.arcTo(0); }); +assert_throws(new TypeError(), function() { ctx.arcTo(0, 0); }); +assert_throws(new TypeError(), function() { ctx.arcTo(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.arcTo(0, 0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.rect(); }); +assert_throws(new TypeError(), function() { ctx.rect(0); }); +assert_throws(new TypeError(), function() { ctx.rect(0, 0); }); +assert_throws(new TypeError(), function() { ctx.rect(0, 0, 0); }); +assert_throws(new TypeError(), function() { ctx.arc(); }); +assert_throws(new TypeError(), function() { ctx.arc(0); }); +assert_throws(new TypeError(), function() { ctx.arc(0, 0); }); +assert_throws(new TypeError(), function() { ctx.arc(0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.arc(0, 0, 1, 0); }); +// (6th argument to arc is optional) +if (ctx.isPointInPath) { + assert_throws(new TypeError(), function() { ctx.isPointInPath(); }); + assert_throws(new TypeError(), function() { ctx.isPointInPath(0); }); +} +if (ctx.drawFocusRing) { + assert_throws(new TypeError(), function() { ctx.drawFocusRing(); }); + assert_throws(new TypeError(), function() { ctx.drawFocusRing(canvas); }); + assert_throws(new TypeError(), function() { ctx.drawFocusRing(canvas, 0); }); +} +if (ctx.fillText) { + assert_throws(new TypeError(), function() { ctx.fillText(); }); + assert_throws(new TypeError(), function() { ctx.fillText('test'); }); + assert_throws(new TypeError(), function() { ctx.fillText('test', 0); }); + assert_throws(new TypeError(), function() { ctx.strokeText(); }); + assert_throws(new TypeError(), function() { ctx.strokeText('test'); }); + assert_throws(new TypeError(), function() { ctx.strokeText('test', 0); }); + assert_throws(new TypeError(), function() { ctx.measureText(); }); +} +assert_throws(new TypeError(), function() { ctx.drawImage(); }); +assert_throws(new TypeError(), function() { ctx.drawImage(canvas); }); +assert_throws(new TypeError(), function() { ctx.drawImage(canvas, 0); }); +// TODO: n >= 3 args on drawImage could be either a valid overload, +// or too few for another overload, or too many for another +// overload - what should happen? +if (ctx.createImageData) { + assert_throws(new TypeError(), function() { ctx.createImageData(); }); + assert_throws(new TypeError(), function() { ctx.createImageData(1); }); +} +if (ctx.getImageData) { + assert_throws(new TypeError(), function() { ctx.getImageData(); }); + assert_throws(new TypeError(), function() { ctx.getImageData(0); }); + assert_throws(new TypeError(), function() { ctx.getImageData(0, 0); }); + assert_throws(new TypeError(), function() { ctx.getImageData(0, 0, 1); }); +} +if (ctx.putImageData) { + var imgdata = ctx.getImageData(0, 0, 1, 1); + assert_throws(new TypeError(), function() { ctx.putImageData(); }); + assert_throws(new TypeError(), function() { ctx.putImageData(imgdata); }); + assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 0); }); +} +var g = ctx.createLinearGradient(0, 0, 0, 0); +assert_throws(new TypeError(), function() { g.addColorStop(); }); +assert_throws(new TypeError(), function() { g.addColorStop(0); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/conformance-requirements/2d.type.delete.html b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.type.delete.html new file mode 100644 index 000000000..4097c35dd --- /dev/null +++ b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.type.delete.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.type.delete</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.type.delete</h1> +<p class="desc">window.CanvasRenderingContext2D is Configurable</p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("window.CanvasRenderingContext2D is Configurable"); +_addTest(function(canvas, ctx) { + +_assertDifferent(window.CanvasRenderingContext2D, undefined, "window.CanvasRenderingContext2D", "undefined"); +_assertSame(delete window.CanvasRenderingContext2D, true, "delete window.CanvasRenderingContext2D", "true"); +_assertSame(window.CanvasRenderingContext2D, undefined, "window.CanvasRenderingContext2D", "undefined"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/conformance-requirements/2d.voidreturn.html b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.voidreturn.html new file mode 100644 index 000000000..b23595c17 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/conformance-requirements/2d.voidreturn.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.voidreturn</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.voidreturn</h1> +<p class="desc">void methods return undefined</p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("void methods return undefined"); +_addTest(function(canvas, ctx) { + +_assertSame(ctx.save(), undefined, "ctx.save()", "undefined"); +_assertSame(ctx.restore(), undefined, "ctx.restore()", "undefined"); +_assertSame(ctx.scale(1, 1), undefined, "ctx.scale(1, 1)", "undefined"); +_assertSame(ctx.rotate(0), undefined, "ctx.rotate(0)", "undefined"); +_assertSame(ctx.translate(0, 0), undefined, "ctx.translate(0, 0)", "undefined"); +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + _assertSame(ctx.transform(1, 0, 0, 1, 0, 0), undefined, "ctx.transform(1, 0, 0, 1, 0, 0)", "undefined"); +} +if (ctx.setTransform) { + _assertSame(ctx.setTransform(1, 0, 0, 1, 0, 0), undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0)", "undefined"); +} +_assertSame(ctx.clearRect(0, 0, 0, 0), undefined, "ctx.clearRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.fillRect(0, 0, 0, 0), undefined, "ctx.fillRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.strokeRect(0, 0, 0, 0), undefined, "ctx.strokeRect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.beginPath(), undefined, "ctx.beginPath()", "undefined"); +_assertSame(ctx.closePath(), undefined, "ctx.closePath()", "undefined"); +_assertSame(ctx.moveTo(0, 0), undefined, "ctx.moveTo(0, 0)", "undefined"); +_assertSame(ctx.lineTo(0, 0), undefined, "ctx.lineTo(0, 0)", "undefined"); +_assertSame(ctx.quadraticCurveTo(0, 0, 0, 0), undefined, "ctx.quadraticCurveTo(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0), undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arcTo(0, 0, 0, 0, 1), undefined, "ctx.arcTo(0, 0, 0, 0, 1)", "undefined"); +_assertSame(ctx.rect(0, 0, 0, 0), undefined, "ctx.rect(0, 0, 0, 0)", "undefined"); +_assertSame(ctx.arc(0, 0, 1, 0, 0, true), undefined, "ctx.arc(0, 0, 1, 0, 0, true)", "undefined"); +_assertSame(ctx.fill(), undefined, "ctx.fill()", "undefined"); +_assertSame(ctx.stroke(), undefined, "ctx.stroke()", "undefined"); +_assertSame(ctx.clip(), undefined, "ctx.clip()", "undefined"); +if (ctx.fillText) { + _assertSame(ctx.fillText('test', 0, 0), undefined, "ctx.fillText('test', 0, 0)", "undefined"); + _assertSame(ctx.strokeText('test', 0, 0), undefined, "ctx.strokeText('test', 0, 0)", "undefined"); +} +if (ctx.putImageData) { + _assertSame(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0), undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0)", "undefined"); +} +_assertSame(ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0)", "undefined"); +_assertSame(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white'), undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white')", "undefined"); + + +}); +</script> +<img src="/images/yellow.png" id="yellow.png" class="resource"> + |