aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzakorgyula <gyula.zakor@gmail.com>2016-10-07 13:10:17 +0200
committerzakorgyula <gyula.zakor@gmail.com>2016-11-04 15:36:48 +0100
commit0eeb56b5492fb6a3cc422193e7b753bc55f3cff3 (patch)
tree4a3ffb64f19558ca765783236061e668701f90a8
parentbaa024e3621fc2e8767d594836fa46987779ccfc (diff)
downloadservo-0eeb56b5492fb6a3cc422193e7b753bc55f3cff3.tar.gz
servo-0eeb56b5492fb6a3cc422193e7b753bc55f3cff3.zip
Remove not allowed services when calling getPrimaryServices.
-rw-r--r--components/bluetooth/lib.rs3
-rw-r--r--tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/blacklisted-services.html.ini4
-rw-r--r--tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html.ini4
3 files changed, 3 insertions, 8 deletions
diff --git a/components/bluetooth/lib.rs b/components/bluetooth/lib.rs
index 69b22b60e11..55c883917f6 100644
--- a/components/bluetooth/lib.rs
+++ b/components/bluetooth/lib.rs
@@ -681,6 +681,9 @@ impl BluetoothManager {
}
}
}
+ services_vec.retain(|s| self.allowed_services
+ .get(&device_id)
+ .map_or(false, |uuids| uuids.contains(&s.uuid)));
if services_vec.is_empty() {
return drop(sender.send(Err(BluetoothError::NotFound)));
}
diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/blacklisted-services.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/blacklisted-services.html.ini
deleted file mode 100644
index 4cc7d7067e4..00000000000
--- a/tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/blacklisted-services.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[blacklisted-services.html]
- type: testharness
- [Request for services. Does not return blacklisted service.]
- expected: FAIL
diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html.ini
deleted file mode 100644
index e7abcfb7c1f..00000000000
--- a/tests/wpt/mozilla/meta/mozilla/bluetooth/getPrimaryServices/no-permission-present-service.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[no-permission-present-service.html]
- type: testharness
- [Request for present service without permission. Reject with NotFoundError.]
- expected: FAIL