mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update web-platform-tests to revision cfada7e6cb379699fa94c7ed8fcb97082327e10c
This commit is contained in:
parent
87e7e3d429
commit
06b00da16b
179 changed files with 6103 additions and 1186 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