OLD | NEW |
1 /* | 1 /* |
2 * geolocation-mock contains a mock implementation of GeolocationService and | 2 * geolocation-mock contains a mock implementation of GeolocationService and |
3 * PermissionService. | 3 * PermissionService. |
4 */ | 4 */ |
5 | 5 |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 let geolocationServiceMock = loadMojoModules( | 8 let geolocationServiceMock = loadMojoModules( |
9 'geolocationServiceMock', | 9 'geolocationServiceMock', |
10 ['device/geolocation/public/interfaces/geolocation.mojom', | 10 ['device/geolocation/public/interfaces/geolocation.mojom', |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 this.rejectGeolocationConnections_ = false; | 53 this.rejectGeolocationConnections_ = false; |
54 | 54 |
55 this.geolocationBindingSet_ = new bindings.BindingSet( | 55 this.geolocationBindingSet_ = new bindings.BindingSet( |
56 geolocation.GeolocationService); | 56 geolocation.GeolocationService); |
57 this.permissionBindingSet_ = new bindings.BindingSet( | 57 this.permissionBindingSet_ = new bindings.BindingSet( |
58 permission.PermissionService); | 58 permission.PermissionService); |
59 } | 59 } |
60 | 60 |
61 connectGeolocation_(handle) { | 61 connectGeolocation_(handle) { |
62 if (this.rejectGeolocationConnections_) { | 62 if (this.rejectGeolocationConnections_) { |
63 mojo.core.close(handle); | 63 handle.close(); |
64 return; | 64 return; |
65 } | 65 } |
66 this.geolocationBindingSet_.addBinding(this, handle); | 66 this.geolocationBindingSet_.addBinding(this, handle); |
67 } | 67 } |
68 | 68 |
69 connectPermission_(handle) { | 69 connectPermission_(handle) { |
70 if (this.rejectPermissionConnections_) { | 70 if (this.rejectPermissionConnections_) { |
71 mojo.core.close(handle); | 71 handle.close(); |
72 return; | 72 return; |
73 } | 73 } |
74 this.permissionBindingSet_.addBinding(this, handle); | 74 this.permissionBindingSet_.addBinding(this, handle); |
75 } | 75 } |
76 | 76 |
77 setHighAccuracy(highAccuracy) { | 77 setHighAccuracy(highAccuracy) { |
78 // FIXME: We need to add some tests regarding "high accuracy" mode. | 78 // FIXME: We need to add some tests regarding "high accuracy" mode. |
79 // See https://bugs.webkit.org/show_bug.cgi?id=49438 | 79 // See https://bugs.webkit.org/show_bug.cgi?id=49438 |
80 } | 80 } |
81 | 81 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 setGeolocationPermission(allowed) { | 177 setGeolocationPermission(allowed) { |
178 this.permissionStatus_ = allowed ? | 178 this.permissionStatus_ = allowed ? |
179 permissionStatus.PermissionStatus.GRANTED : | 179 permissionStatus.PermissionStatus.GRANTED : |
180 permissionStatus.PermissionStatus.DENIED; | 180 permissionStatus.PermissionStatus.DENIED; |
181 this.runPermissionCallback_(); | 181 this.runPermissionCallback_(); |
182 } | 182 } |
183 | 183 |
184 } | 184 } |
185 return new GeolocationServiceMock(mojo.frameInterfaces); | 185 return new GeolocationServiceMock(mojo.frameInterfaces); |
186 }); | 186 }); |
OLD | NEW |