mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 30a08266e1951b16ab2587068de64041095bbc2f
This commit is contained in:
parent
7b5ec99d25
commit
19a2b8047d
185 changed files with 3858 additions and 329 deletions
|
@ -40,27 +40,16 @@ detection_test("BarcodeDetectionTest", async (t, detectionTest) => {
|
|||
shapeDetection.mojom.BarcodeFormat.QR_CODE],
|
||||
"formats");
|
||||
|
||||
try {
|
||||
new BarcodeDetector({formats: []});
|
||||
assert_unreached("providing hint option that is empty should fail");
|
||||
} catch (error) {
|
||||
assert_equals(error.name, "TypeError");
|
||||
}
|
||||
const invalidFormats = [
|
||||
[],
|
||||
["unknown"],
|
||||
["foo", "bar"]
|
||||
];
|
||||
|
||||
try {
|
||||
new BarcodeDetector({formats: ["unknown"]});
|
||||
assert_unreached("providing \"unknown\" as a hint option should fail");
|
||||
} catch (error) {
|
||||
assert_equals(error.name, "TypeError");
|
||||
}
|
||||
invalidFormats.forEach(invalidFormat => {
|
||||
assert_throws_js(TypeError, () => new BarcodeDetector({formats: invalidFormat}));
|
||||
});
|
||||
|
||||
try {
|
||||
new BarcodeDetector({formats: ["foo", "bar"]});
|
||||
assert_unreached(
|
||||
"providing hint option with unrecognized formats should fail");
|
||||
} catch (error) {
|
||||
assert_equals(error.name, "TypeError");
|
||||
}
|
||||
}, "Test that BarcodeDetectorOptions are correctly propagated");
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue