Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html

Issue 2588293005: Shape Detection: Add Text Detection in Chrome Android (Closed)
Patch Set: jochen@ comments, rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
diff --git a/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html b/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
index c4ab7b5b0cf5aa41e144c9c47e43db09849baa12..e84cbf2123399920946a4a30f83dac15511ae82f 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
+++ b/third_party/WebKit/LayoutTests/shapedetection/detection-HTMLImageElement.html
@@ -4,6 +4,7 @@
<script src="../resources/mojo-helpers.js"></script>
<script src="resources/mock-barcodedetection.js"></script>
<script src="resources/mock-facedetection.js"></script>
+<script src="resources/mock-textdetection.js"></script>
<body>
<img id="img" src="../media/content/greenbox.png"/>
</body>
@@ -52,6 +53,12 @@ function BarcodeDetectorDetectionResultTest(detectionResult, mock) {
assert_equals(detectionResult[1].rawValue, "dogs", "barcode 2");
}
+function TextDetectorDetectionResultTest(detectionResult, mock) {
+ assert_equals(detectionResult.length, 2, "Number of textBlocks");
+ assert_equals(detectionResult[0].rawValue, "cats", "textBlock 1");
+ assert_equals(detectionResult[1].rawValue, "dogs", "textBlock 2");
+}
+
// These tests verify that a Detector's detect() works on an HTMLImageElement.
// Use the mock mojo server implemented in mock-{barcode,face}detection.js.
generate_tests(createTestForImageElement, [
@@ -66,6 +73,12 @@ generate_tests(createTestForImageElement, [
() => { return new BarcodeDetector(); },
() => { return mockBarcodeDetectionReady; },
BarcodeDetectorDetectionResultTest
+ ],
+ [
+ "Text",
+ () => { return new TextDetector(); },
+ () => { return mockTextDetectionReady; },
+ TextDetectorDetectionResultTest
]
]);

Powered by Google App Engine
This is Rietveld 408576698