Update web-platform-tests to revision 30a08266e1951b16ab2587068de64041095bbc2f

This commit is contained in:
WPT Sync Bot 2020-04-08 08:19:32 +00:00
parent 7b5ec99d25
commit 19a2b8047d
185 changed files with 3858 additions and 329 deletions

View file

@ -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>