Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js |
| diff --git a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js |
| index fd9719a503127e16868524ab3d36bc68be4464de..25cd7911ae71e0cd5361909ffb104661d0179ba3 100644 |
| --- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js |
| +++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js |
| @@ -318,6 +318,18 @@ class EventCatcher { |
| } |
| } |
| +// Returns a function that when called returns a promise that resolves when |
|
scheib
2016/10/25 04:28:05
Returns via a promise a function 'request_disconne
ortuno
2016/10/26 04:03:22
Done.
|
| +// the device has disconnected. |
| +function get_request_disconnection(gattServer) { |
| + return gattServer.getPrimaryService(request_disconnection_service_uuid) |
| + .then(service => service.getCharacteristic(request_disconnection_characteristic_uuid)) |
| + .then(characteristic => { |
| + // TODO(crbug.com/543466): Wrap in assert_promise_rejects_with_message() |
| + // once connection is required for writeValue to succeed. |
| + return () => characteristic.writeValue(new Uint8Array([0])); |
| + }); |
| +} |
| + |
| function generateRequestDeviceArgsWithServices(services = ['heart_rate']) { |
| return [{ |
| filters: [{ services: services }] |