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

@ -35,6 +35,20 @@ const canvasElementTests =
mockTestName: "BarcodeDetectionTest",
detectionResultTest: BarcodeDetectorDetectionResultTest,
name: "Barcode - detect(OffscreenCanvas)"
},
{
createDetector: () => { return new TextDetector(); },
createCanvas: () => { return document.createElement("canvas"); },
mockTestName: "TextDetectionTest",
detectionResultTest: TextDetectorDetectionResultTest,
name: "Text - detect(HTMLCanvasElement)"
},
{
createDetector: () => { return new TextDetector(); },
createCanvas: () => { return new OffscreenCanvas(300, 150); },
mockTestName: "TextDetectionTest",
detectionResultTest: TextDetectorDetectionResultTest,
name: "Text - detect(OffscreenCanvas)"
}
];
@ -70,4 +84,10 @@ function BarcodeDetectorDetectionResultTest(detectionResult, mockTest) {
assert_equals(detectionResult[1].format, "code_128", "barcode 2 format");
}
function TextDetectorDetectionResultTest(detectionResult, mockTest) {
assert_equals(detectionResult.length, 2, "Number of textBlocks");
assert_equals(detectionResult[0].rawValue, "cats", "textBlock 1");
assert_equals(detectionResult[1].rawValue, "dogs", "textBlock 2");
}
</script>