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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: rebase to master 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html b/third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html
new file mode 100644
index 0000000000000000000000000000000000000000..eb43af6ef16721084a547468e92363c950ef4fa5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptors/blocklisted-descriptors-not-present.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../../resources/bluetooth/bluetooth-helpers.js"></script>
+<script>
+'use strict';
+promise_test(() => {
+ // DisconnectingHealthThermometerAdapter's measurement_interval contains
+ // one blocklisted descriptor. Make sure that it isn't returned in the result
+ // of getDescriptors().
+ return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
+ .then(() => requestDeviceWithKeyDown({
+ filters: [{services: ['health_thermometer']}]}))
+ .then(device => device.gatt.connect())
+ .then(gattServer => gattServer.getPrimaryService('health_thermometer'))
+ .then(service => service.getCharacteristic('measurement_interval'))
+ .then(characteristic => characteristic.getDescriptors())
+ .then(descriptors => {
+ descriptors.forEach(
+ descriptor => {
ortuno 2016/12/08 05:42:51 nit: Move to previous line.
dougt 2016/12/08 08:35:58 Done.
+ let bad_uuid = 'bad2ddcf-60db-45cd-bef9-fd72b153cf7c';
ortuno 2016/12/08 05:42:51 nit: Move this to resources. https://cs.chromium.o
dougt 2016/12/08 08:35:58 Done.
+ // bad_uuid is a blocklisted UUID. It should never be present
+ // in a getDescriptors() result.
+ assert_true(descriptor.uuid != bad_uuid)
+ });
+ })
+}, 'Making sure no blocklisted descriptors are present. ');
+
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698