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

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

Issue 2522143002: ShapeDetection: split mojom into face and barcode interfaces (Closed)
Patch Set: Smart rebase to https://crrev.com/2527503003 (FaceDetectorOptions) Created 4 years, 1 month 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-ImageBitmap.html
diff --git a/third_party/WebKit/LayoutTests/shapedetection/detectshape-ImageBitmap.html b/third_party/WebKit/LayoutTests/shapedetection/detection-ImageBitmap.html
similarity index 72%
rename from third_party/WebKit/LayoutTests/shapedetection/detectshape-ImageBitmap.html
rename to third_party/WebKit/LayoutTests/shapedetection/detection-ImageBitmap.html
index 02d3b0eb4b1ec91d5f400ef590bde0176a315b44..ce09411b3b6725623c0fbc53012bd4882865fa04 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/detectshape-ImageBitmap.html
+++ b/third_party/WebKit/LayoutTests/shapedetection/detection-ImageBitmap.html
@@ -2,10 +2,12 @@
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/mojo-helpers.js"></script>
-<script src="resources/mock-shapedetection.js"></script>
+<script src="resources/mock-barcodedetection.js"></script>
+<script src="resources/mock-facedetection.js"></script>
<script>
-var createTestForImageBitmap = function(detectorName, detectionResultTest) {
+var createTestForImageBitmap = function(detectorName, mockReady,
+ detectionResultTest) {
async_test(function(t) {
var img = new Image();
@@ -16,7 +18,7 @@ var createTestForImageBitmap = function(detectorName, detectionResultTest) {
createImageBitmap(img)
.then(imageBitmap => {
theImageBitmap = imageBitmap;
- return mockShapeDetectionReady;
+ return mockReady();
})
.catch(error => {
assert_unreached('createImageBitmap() error: ' + error);
@@ -27,7 +29,7 @@ var createTestForImageBitmap = function(detectorName, detectionResultTest) {
return detector;
})
.catch(error => {
- assert_unreached("Error creating MockShapeDetection: " + error);
+ assert_unreached("Error creating MockFaceDetection: " + error);
})
.then(detector => {
return detector.detect(theImageBitmap);
@@ -41,7 +43,7 @@ var createTestForImageBitmap = function(detectorName, detectionResultTest) {
});
}
img.src = '../media/content/greenbox.png';
- }, 'Detector detect(ImageBitmap)');
+ }, "Detector detect(ImageBitmap)");
};
function FaceDetectorDetectionResultTest(detectionResult, mock) {
@@ -59,10 +61,20 @@ function BarcodeDetectorDetectionResultTest(detectionResult, mock) {
}
// These tests verify that a Detector's detect() works on an ImageBitmap.
-// Use the mock mojo server implemented in mock-shapedetection.js.
+// Use the mock mojo server implemented in mock-{barcode,face}detection.js.
generate_tests(createTestForImageBitmap, [
- [ "Face", "FaceDetector", FaceDetectorDetectionResultTest ],
- [ "Barcode", "BarcodeDetector", BarcodeDetectorDetectionResultTest ]
+ [
+ "Face",
+ "FaceDetector",
+ () => { return mockFaceDetectionReady; },
+ FaceDetectorDetectionResultTest
+ ],
+ [
+ "Barcode",
+ "BarcodeDetector",
+ () => { return mockBarcodeDetectionReady; },
+ BarcodeDetectorDetectionResultTest
+ ]
]);
</script>

Powered by Google App Engine
This is Rietveld 408576698