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

Side by Side Diff: third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js

Issue 2575943002: Barcode Detection: Add |cornerPoints| to DetectedBarcode.idl (Closed)
Patch Set: mcasas@ comments Created 4 years 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 unified diff | Download patch
OLDNEW
1 "use strict"; 1 "use strict";
2 2
3 let mockBarcodeDetectionReady = define( 3 let mockBarcodeDetectionReady = define(
4 'mockBarcodeDetection', 4 'mockBarcodeDetection',
5 ['third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.m ojom', 5 ['third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.m ojom',
6 'mojo/public/js/bindings', 6 'mojo/public/js/bindings',
7 'mojo/public/js/connection', 7 'mojo/public/js/connection',
8 'mojo/public/js/core', 8 'mojo/public/js/core',
9 'content/public/renderer/frame_interfaces', 9 'content/public/renderer/frame_interfaces',
10 ], (barcodeDetection, bindings, connection, mojo, interfaces) => { 10 ], (barcodeDetection, bindings, connection, mojo, interfaces) => {
(...skipping 11 matching lines...) Expand all
22 bindings.StubBindings(this.stub_).delegate = this; 22 bindings.StubBindings(this.stub_).delegate = this;
23 } 23 }
24 24
25 detect(frame_data, width, height) { 25 detect(frame_data, width, height) {
26 let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0); 26 let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
27 this.buffer_data_ = new Uint32Array(receivedStruct.buffer); 27 this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
28 return Promise.resolve({ 28 return Promise.resolve({
29 results: [ 29 results: [
30 { 30 {
31 raw_value : "cats", 31 raw_value : "cats",
32 bounding_box: { x : 1.0, y: 1.0, width: 100.0, height: 100.0 }, 32 bounding_box: { x : 1.0, y: 1.0, width: 100.0, height: 100.0 },
Reilly Grant (use Gerrit) 2016/12/15 23:44:30 s/x :/x:/g
xianglu 2016/12/16 00:01:25 Done.
33 corner_points: [
34 { x : 1.0, y: 1.0},
35 { x : 1.0, y: 101.0},
36 { x : 101.0, y: 1.0},
Reilly Grant (use Gerrit) 2016/12/15 23:44:30 { x: 101.0, y: 101.0 } ?
xianglu 2016/12/16 00:01:25 Done.
37 { x : 101.0, y: 1.0}
38 ],
33 }, 39 },
34 { 40 {
35 raw_value : "dogs", 41 raw_value : "dogs",
36 bounding_box: { x : 2.0, y: 2.0, width: 50.0, height: 50.0 }, 42 bounding_box: { x : 2.0, y: 2.0, width: 50.0, height: 50.0 },
43 corner_points: [
44 { x : 2.0, y: 2.0},
45 { x : 2.0, y: 52.0},
46 { x : 52.0, y: 52.0},
47 { x : 52.0, y: 2.0}
48 ],
37 }, 49 },
38 ], 50 ],
39 }); 51 });
40 mojo.unmapBuffer(receivedStruct.buffer); 52 mojo.unmapBuffer(receivedStruct.buffer);
41 } 53 }
42 54
43 getFrameData() { 55 getFrameData() {
44 return this.buffer_data_; 56 return this.buffer_data_;
45 } 57 }
46 } 58 }
47 return new MockBarcodeDetection(); 59 return new MockBarcodeDetection();
48 }); 60 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698