mirror of
https://github.com/servo/servo.git
synced 2025-09-10 23:18:20 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -1,14 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.create2.round</title>
|
||||
<title>Canvas test: 2d.imageData.create2.double</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.imageData.create2.round</h1>
|
||||
<p class="desc">createImageData(w, h) is rounded the same as getImageData(0, 0, w, h)</p>
|
||||
<h1>2d.imageData.create2.double</h1>
|
||||
<p class="desc">createImageData(w, h) double is converted to long</p>
|
||||
|
||||
|
||||
<p class="output">Actual output:</p>
|
||||
|
@ -16,13 +16,15 @@
|
|||
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("createImageData(w, h) is rounded the same as getImageData(0, 0, w, h)");
|
||||
var t = async_test("createImageData(w, h) double is converted to long");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
var imgdata1 = ctx.createImageData(10.01, 10.99);
|
||||
var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99);
|
||||
_assertSame(imgdata1.width, imgdata2.width, "imgdata1.width", "imgdata2.width");
|
||||
_assertSame(imgdata1.height, imgdata2.height, "imgdata1.height", "imgdata2.height");
|
||||
var imgdata2 = ctx.createImageData(-10.01, -10.99);
|
||||
_assertSame(imgdata1.width, 10, "imgdata1.width", "10");
|
||||
_assertSame(imgdata1.height, 10, "imgdata1.height", "10");
|
||||
_assertSame(imgdata2.width, 10, "imgdata2.width", "10");
|
||||
_assertSame(imgdata2.height, 10, "imgdata2.height", "10");
|
||||
|
||||
|
||||
});
|
|
@ -1,35 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.create2.tiny</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.imageData.create2.tiny</h1>
|
||||
<p class="desc">createImageData(sw, sh) works for sizes smaller than one pixel</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("createImageData(sw, sh) works for sizes smaller than one pixel");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
var imgdata = ctx.createImageData(0.0001, 0.0001);
|
||||
_assertSame(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
|
||||
_assertSame(imgdata.width, 1, "imgdata.width", "1");
|
||||
_assertSame(imgdata.height, 1, "imgdata.height", "1");
|
||||
var isTransparentBlack = true;
|
||||
for (var i = 0; i < imgdata.data.length; ++i)
|
||||
if (imgdata.data[i] !== 0)
|
||||
isTransparentBlack = false;
|
||||
_assert(isTransparentBlack, "isTransparentBlack");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -22,6 +22,8 @@ _addTest(function(canvas, ctx) {
|
|||
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(10, 0); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(0, 10); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(0, 0); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(0.99, 10); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.createImageData(10, 0.1); });
|
||||
|
||||
|
||||
});
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.get.double</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.imageData.get.double</h1>
|
||||
<p class="desc">createImageData(w, h) double is converted to long</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("createImageData(w, h) double is converted to long");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
var imgdata1 = ctx.getImageData(0, 0, 10.01, 10.99);
|
||||
var imgdata2 = ctx.getImageData(0, 0, -10.01, -10.99);
|
||||
_assertSame(imgdata1.width, 10, "imgdata1.width", "10");
|
||||
_assertSame(imgdata1.height, 10, "imgdata1.height", "10");
|
||||
_assertSame(imgdata2.width, 10, "imgdata2.width", "10");
|
||||
_assertSame(imgdata2.height, 10, "imgdata2.height", "10");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -22,6 +22,10 @@ _addTest(function(canvas, ctx) {
|
|||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 10, 0); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 0, 10); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 0, 0); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 0.1, 10); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 10, 0.99); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, -0.1, 10); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 10, -0.99); });
|
||||
|
||||
|
||||
});
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.object.ctor.array.bounds</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.imageData.object.ctor.array.bounds</h1>
|
||||
<p class="desc">ImageData has a usable constructor</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("ImageData has a usable constructor");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
|
||||
|
||||
assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedArray(0), 1); });
|
||||
assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedArray(3), 1); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 0); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 1, 2); });
|
||||
assert_throws(new TypeError(), function() { new ImageData(new Uint8Array(8), 1, 2); });
|
||||
assert_throws(new TypeError(), function() { new ImageData(new Int8Array(8), 1, 2); });
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.get.tiny</title>
|
||||
<title>Canvas test: 2d.imageData.object.ctor.array</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.imageData.get.tiny</h1>
|
||||
<p class="desc">getImageData() works for sizes smaller than one pixel</p>
|
||||
<h1>2d.imageData.object.ctor.array</h1>
|
||||
<p class="desc">ImageData has a usable constructor</p>
|
||||
|
||||
|
||||
<p class="output">Actual output:</p>
|
||||
|
@ -16,13 +16,16 @@
|
|||
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("getImageData() works for sizes smaller than one pixel");
|
||||
var t = async_test("ImageData has a usable constructor");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001);
|
||||
_assertSame(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
|
||||
_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
|
||||
|
||||
var array = new Uint8ClampedArray(8);
|
||||
var imgdata = new window.ImageData(array, 1, 2);
|
||||
_assertSame(imgdata.width, 1, "imgdata.width", "1");
|
||||
_assertSame(imgdata.height, 1, "imgdata.height", "1");
|
||||
_assertSame(imgdata.height, 2, "imgdata.height", "2");
|
||||
_assertSame(imgdata.data, array, "imgdata.data", "array");
|
||||
|
||||
|
||||
});
|
|
@ -1,14 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.object.ctor</title>
|
||||
<title>Canvas test: 2d.imageData.object.ctor.size.bounds</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.imageData.object.ctor</h1>
|
||||
<p class="desc">ImageData does not have a usable constructor</p>
|
||||
<h1>2d.imageData.object.ctor.size.bounds</h1>
|
||||
<p class="desc">ImageData has a usable constructor</p>
|
||||
|
||||
|
||||
<p class="output">Actual output:</p>
|
||||
|
@ -16,11 +16,13 @@
|
|||
|
||||
<ul id="d"></ul>
|
||||
<script>
|
||||
var t = async_test("ImageData does not have a usable constructor");
|
||||
var t = async_test("ImageData has a usable constructor");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
|
||||
assert_throws(new TypeError(), function() { new window.ImageData(1,1); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { new window.ImageData(0, 0); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { new window.ImageData(0, 1); });
|
||||
assert_throws("INDEX_SIZE_ERR", function() { new window.ImageData(1, 0); });
|
||||
|
||||
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.imageData.object.ctor.size</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.imageData.object.ctor.size</h1>
|
||||
<p class="desc">ImageData has a usable constructor</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("ImageData has a usable constructor");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
|
||||
|
||||
var imgdata = new window.ImageData(2, 3);
|
||||
_assertSame(imgdata.width, 2, "imgdata.width", "2");
|
||||
_assertSame(imgdata.height, 3, "imgdata.height", "3");
|
||||
_assertSame(imgdata.data.length, 2 * 3 * 4, "imgdata.data.length", "2 * 3 * 4");
|
||||
for (var i = 0; i < imgdata.data.length; ++i) {
|
||||
_assertSame(imgdata.data[i], 0, "imgdata.data[\""+(i)+"\"]", "0");
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue