diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-23 03:22:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-23 03:22:43 -0800 |
commit | c4b7cc863eb9c0387577be33db4e2c0a6fd92a60 (patch) | |
tree | 5a3d65940c3a82fe95988cf70d969c16b9690c0d /components/bluetooth/test.rs | |
parent | 5946f756d788a5ce9c8f6447b4fa04d57daf9076 (diff) | |
parent | fd7cdbf19fd4ad6ddb173d4b4061c3098ef29520 (diff) | |
download | servo-c4b7cc863eb9c0387577be33db4e2c0a6fd92a60.tar.gz servo-c4b7cc863eb9c0387577be33db4e2c0a6fd92a60.zip |
Auto merge of #14276 - szeged:notify, r=jdm
Add Start/Stop notifications
Add support for Start and Stop Notifications for WebBluetooth
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are tests for these changes
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14276)
<!-- Reviewable:end -->
Diffstat (limited to 'components/bluetooth/test.rs')
-rw-r--r-- | components/bluetooth/test.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/bluetooth/test.rs b/components/bluetooth/test.rs index b4aa7ef286b..8578db79aa5 100644 --- a/components/bluetooth/test.rs +++ b/components/bluetooth/test.rs @@ -18,6 +18,7 @@ const ADAPTER_ERROR: &'static str = "No adapter found"; const WRONG_DATA_SET_ERROR: &'static str = "Wrong data set name was provided"; const READ_FLAG: &'static str = "read"; const WRITE_FLAG: &'static str = "write"; +const NOTIFY_FLAG: &'static str = "notify"; // Adapter names // https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=65 @@ -217,10 +218,11 @@ fn create_heart_rate_service(device: &BluetoothDevice, } // Heart Rate Measurement Characteristic - let _heart_rate_measurement_characteristic = + let heart_rate_measurement_characteristic = try!(create_characteristic_with_value(&heart_rate_service, HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID.to_owned(), vec![0])); + try!(heart_rate_measurement_characteristic.set_flags(vec![NOTIFY_FLAG.to_string()])); // Body Sensor Location Characteristic 1 let body_sensor_location_characteristic_1 = @@ -357,10 +359,11 @@ fn create_two_heart_rate_services_device(adapter: &BluetoothAdapter) -> Result<( let heart_rate_service_empty_2 = try!(create_heart_rate_service(&heart_rate_device_empty, true)); - let _heart_rate_measurement_characteristic = + let heart_rate_measurement_characteristic = try!(create_characteristic_with_value(&heart_rate_service_empty_1, HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID.to_owned(), vec![0])); + try!(heart_rate_measurement_characteristic.set_flags(vec![NOTIFY_FLAG.to_string()])); let _body_sensor_location_characteristic_1 = try!(create_characteristic_with_value(&heart_rate_service_empty_1, |