| OLD | NEW |
| 1 "use strict"; | 1 "use strict"; |
| 2 | 2 |
| 3 let mockFaceDetectionProviderReady = define( | 3 let mockFaceDetectionProviderReady = define( |
| 4 'mockFaceDetectionProvider', | 4 'mockFaceDetectionProvider', |
| 5 ['third_party/WebKit/public/platform/modules/shapedetection/facedetection.mojo
m', | 5 ['third_party/WebKit/public/platform/modules/shapedetection/facedetection.mojo
m', |
| 6 'third_party/WebKit/public/platform/modules/shapedetection/facedetection_prov
ider.mojom', | 6 'third_party/WebKit/public/platform/modules/shapedetection/facedetection_prov
ider.mojom', |
| 7 'mojo/public/js/bindings', | 7 'mojo/public/js/bindings', |
| 8 'mojo/public/js/core', | 8 'mojo/public/js/core', |
| 9 'content/public/renderer/frame_interfaces', | 9 'content/public/renderer/frame_interfaces', |
| 10 ], (faceDetection, faceDetectionProvider, bindings, mojo, interfaces) => { | 10 ], (faceDetection, faceDetectionProvider, bindings, mojo, interfaces) => { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 this.binding_ = new bindings.Binding(faceDetection.FaceDetection, this, | 43 this.binding_ = new bindings.Binding(faceDetection.FaceDetection, this, |
| 44 request); | 44 request); |
| 45 } | 45 } |
| 46 | 46 |
| 47 detect(frame_data, width, height) { | 47 detect(frame_data, width, height) { |
| 48 let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0); | 48 let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0); |
| 49 this.buffer_data_ = new Uint32Array(receivedStruct.buffer); | 49 this.buffer_data_ = new Uint32Array(receivedStruct.buffer); |
| 50 return Promise.resolve({ | 50 return Promise.resolve({ |
| 51 result: { | 51 result: { |
| 52 bounding_boxes: [ | 52 bounding_boxes: [ |
| 53 { x : 1.0, y: 1.0, width: 100.0, height: 100.0 }, | 53 { x : 1.0, y: 1.0, width: 100.0, height: 100.0 }, |
| 54 { x : 2.0, y: 2.0, width: 200.0, height: 200.0 }, | 54 { x : 2.0, y: 2.0, width: 200.0, height: 200.0 }, |
| 55 { x : 3.0, y: 3.0, width: 300.0, height: 300.0 }, | 55 { x : 3.0, y: 3.0, width: 300.0, height: 300.0 }, |
| 56 ] | 56 ] |
| 57 } | 57 } |
| 58 }); | 58 }); |
| 59 mojo.unmapBuffer(receivedStruct.buffer); | 59 mojo.unmapBuffer(receivedStruct.buffer); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 return new MockFaceDetectionProvider(); | 62 return new MockFaceDetectionProvider(); |
| 63 }); | 63 }); |
| OLD | NEW |