Update web-platform-tests to revision b'797e75946c24d0625f04247b16d33c26d4ada273'
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 93 KiB |
BIN
tests/wpt/web-platform-tests/shape-detection/resources/aztec.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 181 KiB |
After Width: | Height: | Size: 187 KiB |
After Width: | Height: | Size: 174 KiB |
After Width: | Height: | Size: 165 KiB |
After Width: | Height: | Size: 168 KiB |
BIN
tests/wpt/web-platform-tests/shape-detection/resources/faces.mov
Normal file
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 37 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 34 KiB |
BIN
tests/wpt/web-platform-tests/shape-detection/resources/qr-h.jpg
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
tests/wpt/web-platform-tests/shape-detection/resources/qr-l.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
tests/wpt/web-platform-tests/shape-detection/resources/qr-m.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
tests/wpt/web-platform-tests/shape-detection/resources/qr-q.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 34 KiB |
|
@ -0,0 +1,66 @@
|
|||
function imageLoadedPromise(image) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
if (image.complete)
|
||||
resolve();
|
||||
image.addEventListener("load", resolve, { once: true });
|
||||
});
|
||||
}
|
||||
|
||||
function videoLoadedPromise(video) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
if (video.readyState == 4)
|
||||
resolve();
|
||||
else {
|
||||
video.addEventListener("loadeddata", resolve, { once: true });
|
||||
video.addEventListener("error", reject, { once: true });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function waitForNFrames(count) {
|
||||
if (count <= 0)
|
||||
return Promise.reject(new TypeError("count should be greater than 0!"));
|
||||
|
||||
return new Promise(resolve => {
|
||||
function tick() {
|
||||
(--count) ? requestAnimationFrame(tick) : resolve();
|
||||
}
|
||||
requestAnimationFrame(tick);
|
||||
});
|
||||
}
|
||||
|
||||
function seekTo(video, time) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
video.addEventListener("seeked", async function() {
|
||||
/* Work around flakiness in video players... */
|
||||
await waitForNFrames(3);
|
||||
resolve();
|
||||
}, { once: true });
|
||||
video.currentTime = time;
|
||||
});
|
||||
}
|
||||
|
||||
function checkBoundingBox(actual, expected, fuzziness) {
|
||||
assert_equals(actual.constructor.name, "DOMRectReadOnly");
|
||||
assert_approx_equals(actual.left, expected.left, fuzziness);
|
||||
assert_approx_equals(actual.right, expected.right, fuzziness);
|
||||
assert_approx_equals(actual.top, expected.top, fuzziness);
|
||||
assert_approx_equals(actual.bottom, expected.bottom, fuzziness);
|
||||
}
|
||||
|
||||
function checkPointsLieWithinBoundingBox(points, boundingBox) {
|
||||
for (point of points) {
|
||||
assert_between_inclusive(point.x, boundingBox.left, boundingBox.right);
|
||||
assert_between_inclusive(point.y, boundingBox.top, boundingBox.bottom);
|
||||
}
|
||||
}
|
||||
|
||||
function checkPointIsNear(actual, expected, fuzzinessX, fuzzinessY) {
|
||||
assert_approx_equals(actual.x, expected.x, fuzzinessX);
|
||||
assert_approx_equals(actual.y, expected.y, fuzzinessY);
|
||||
}
|
||||
|
||||
function checkPointsAreNear(actual, expected, fuzzinessX, fuzzinessY) {
|
||||
for (point of actual)
|
||||
checkPointIsNear(point, expected, fuzzinessX, fuzzinessY);
|
||||
}
|
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 26 KiB |