mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Bug 1307141 - Submit test_setlinedash.html to WPT; r=jgraham
This test was originally written by David Caldwell in changeset d18ebc644b89
(bug 1006656
). He has relicensed his contribution under the CC0 at
<https://bugzilla.mozilla.org/show_bug.cgi?id=1073556#c66>. I am taking his
public domain test and relicensing it under the web-platform-tests licenses.
This commit is contained in:
parent
fcc4788550
commit
ed889873be
@ -261,7 +261,6 @@ tags = imagebitmap
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # bug 1040965
|
||||
[test_2d_composite_canvaspattern_setTransform.html]
|
||||
[test_createPattern_broken.html]
|
||||
[test_setlinedash.html]
|
||||
[test_filter.html]
|
||||
skip-if = (e10s && debug && os == 'win')
|
||||
[test_filter_tainted.html]
|
||||
|
@ -1,42 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Canvas test: toDataURL parameters (Bug 564388)</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
The line dash setting should not be changed when bad values are passed to setLineDash().
|
||||
</p>
|
||||
<p> See:
|
||||
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-setlinedash">
|
||||
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-setlinedash
|
||||
</a>
|
||||
</p>
|
||||
<p>Mozilla
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1006656">Bug 1006656</a>
|
||||
</p>
|
||||
<canvas id="canvas"><p class="fallback">FAIL (fallback content)</p></canvas>
|
||||
|
||||
<script>
|
||||
var canvas = document.getElementById('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
ctx.setLineDash([1,2,3,4,5,6,7,8,9,10]);
|
||||
isDeeply(ctx.getLineDash(), [1,2,3,4,5,6,7,8,9,10], "line dash sanity");
|
||||
|
||||
ctx.setLineDash([1,2,3,4,5,6,7,8,9,10]);
|
||||
ctx.setLineDash([Infinity]);
|
||||
isDeeply(ctx.getLineDash(), [1,2,3,4,5,6,7,8,9,10], "Inf doesn't reset line dash");
|
||||
|
||||
ctx.setLineDash([1,2,3,4,5,6,7,8,9,10]);
|
||||
ctx.setLineDash([NaN]);
|
||||
isDeeply(ctx.getLineDash(), [1,2,3,4,5,6,7,8,9,10], "NaN doesn't reset line dash");
|
||||
|
||||
ctx.setLineDash([1,2,3,4,5,6,7,8,9,10]);
|
||||
ctx.setLineDash([-1]);
|
||||
isDeeply(ctx.getLineDash(), [1,2,3,4,5,6,7,8,9,10], "Negative doesn't reset line dash");
|
||||
</script>
|
||||
|
||||
</html>
|
@ -37411,6 +37411,12 @@
|
||||
]
|
||||
},
|
||||
"testharness": {
|
||||
"2dcontext/line-styles/setLineDash.html": [
|
||||
{
|
||||
"path": "2dcontext/line-styles/setLineDash.html",
|
||||
"url": "/2dcontext/line-styles/setLineDash.html"
|
||||
}
|
||||
],
|
||||
"2dcontext/path-objects/2d.path.lineTo.nonfinite.details.html": [
|
||||
{
|
||||
"path": "2dcontext/path-objects/2d.path.lineTo.nonfinite.details.html",
|
||||
|
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>setLineDash</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<canvas id="canvas"></canvas>
|
||||
<script>
|
||||
test(function() {
|
||||
var canvas = document.getElementById('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
var initial = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
||||
|
||||
ctx.setLineDash(initial);
|
||||
assert_array_equals(ctx.getLineDash(), initial, "line dash sanity");
|
||||
|
||||
ctx.setLineDash([Infinity]);
|
||||
assert_array_equals(ctx.getLineDash(), initial, "Inf doesn't reset line dash");
|
||||
|
||||
ctx.setLineDash([NaN]);
|
||||
assert_array_equals(ctx.getLineDash(), initial, "NaN doesn't reset line dash");
|
||||
|
||||
ctx.setLineDash([-1]);
|
||||
assert_array_equals(ctx.getLineDash(), initial, "Negative doesn't reset line dash");
|
||||
}, "Invalid arguments to setLineDash()");
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user