mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision b7a8b84debb42268ea95a45bdad8f727d1facdf7
This commit is contained in:
parent
ba929208e4
commit
953dbda9a6
215 changed files with 6409 additions and 1644 deletions
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
|
||||
// This test verifies *Detector.detect() returns an empty list when fed with
|
||||
// an empty HTMLImageElement.
|
||||
const emptyInputTests =
|
||||
[
|
||||
{
|
||||
createDetector: () => { return new FaceDetector(); },
|
||||
name: "Face - detect(empty)"
|
||||
},
|
||||
{
|
||||
createDetector: () => { return new BarcodeDetector(); },
|
||||
name: "Barcode - detect(empty)"
|
||||
}
|
||||
];
|
||||
|
||||
for (let emptyInputTest of emptyInputTests) {
|
||||
promise_test(async t =>{
|
||||
const img = new Image();
|
||||
const imgWatcher = new EventWatcher(t, img, ["load", "error"]);
|
||||
img.src = "";
|
||||
await imgWatcher.wait_for("error");
|
||||
|
||||
const detector = emptyInputTest.createDetector();
|
||||
const detectionResult = await detector.detect(img);
|
||||
assert_equals(detectionResult.length, 0);
|
||||
}, emptyInputTest.name);
|
||||
}
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue