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

Unified Diff: third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js

Issue 2502763005: ShapeDetection: Add FaceDetectorOptions for fastMode and maxDetectedFaces (Closed)
Patch Set: 80 cols 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/resources/mock-shapedetection.js
diff --git a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
index e77feec1bf19694137982b069b8f5baa6b89b31a..7c0049d57af514fcf63d4ae2693dfdf85c075833 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
+++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
@@ -22,12 +22,14 @@ let mockShapeDetectionReady = define(
bindings.StubBindings(this.stub_).delegate = this;
}
- detectFaces(frame_data, width, height) {
+ detectFaces(frame_data, width, height, options) {
let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
+ this.maxDetectedFaces_ = options.max_detected_faces;
+ this.fastMode_ = options.fast_mode;
return Promise.resolve({
result: {
- boundingBoxes: [
+ bounding_boxes: [
{ x : 1.0, y: 1.0, width: 100.0, height: 100.0 },
{ x : 2.0, y: 2.0, width: 200.0, height: 200.0 },
{ x : 3.0, y: 3.0, width: 300.0, height: 300.0 },
@@ -58,6 +60,14 @@ let mockShapeDetectionReady = define(
getFrameData() {
return this.buffer_data_;
}
+
+ getMaxDetectedFaces() {
+ return this.maxDetectedFaces_;
+ }
+
+ getFastMode () {
+ return this.fastMode_;
+ }
}
return new MockShapeDetection();
});

Powered by Google App Engine
This is Rietveld 408576698