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

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

Issue 2502723002: ShapeDetection: implement barcode detection, blink part (Closed)
Patch Set: haraken@ comments 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 6ba5fe87f66fbf4282b9a4c4435480fe0cd958d5..e77feec1bf19694137982b069b8f5baa6b89b31a 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
+++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
@@ -22,7 +22,7 @@ let mockShapeDetectionReady = define(
bindings.StubBindings(this.stub_).delegate = this;
}
- detectFace(frame_data, width, height) {
+ detectFaces(frame_data, width, height) {
let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
return Promise.resolve({
@@ -37,6 +37,24 @@ let mockShapeDetectionReady = define(
mojo.unmapBuffer(receivedStruct.buffer);
}
+ detectBarcodes(frame_data, width, height) {
+ let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
+ this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
+ return Promise.resolve({
+ results: [
+ {
+ raw_value : "cats",
+ bounding_box: { x : 1.0, y: 1.0, width: 100.0, height: 100.0 },
+ },
+ {
+ raw_value : "dogs",
+ bounding_box: { x : 2.0, y: 2.0, width: 50.0, height: 50.0 },
+ },
+ ],
+ });
+ mojo.unmapBuffer(receivedStruct.buffer);
+ }
+
getFrameData() {
return this.buffer_data_;
}

Powered by Google App Engine
This is Rietveld 408576698