mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue