Bug 1443340 [wpt PR 9858] - bluetooth: Use DeviceUUID in FakeBluetooth, a=testonly

Automatic update from web-platform-testsbluetooth: Use DeviceUUID in FakeBluetooth

This change refactors the Web Bluetooth test API to use the
DeviceUUIDs helper class defined in BluetoothDevice. Additionally,
this change finishes the implementation of SimulateGATTServicesChanged,
and as a result, tests are updated to set the next discovery response
before calling this interface.

BUG=719826

Change-Id: I0f986eb7afe6fbf7ebaa80ac4b633d46a027b80d
Reviewed-on: https://chromium-review.googlesource.com/939984
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541577}

wpt-commits: 4038be686e4912ac1779f73f9fca8d9cbfbb1ec0
wpt-pr: 9858
wpt-commits: 4038be686e4912ac1779f73f9fca8d9cbfbb1ec0
wpt-pr: 9858
This commit is contained in:
Ovidio Henriquez 2018-03-26 15:27:56 +00:00 коммит произвёл James Graham
Родитель 7ce8097a19
Коммит eb0783f5bb
22 изменённых файлов: 42 добавлений и 21 удалений

Просмотреть файл

@ -399994,7 +399994,7 @@
"testharness"
],
"bluetooth/characteristic/getDescriptor/gen-characteristic-is-removed.https.html": [
"6ba1c71fa5c34f7b0321b5430fa79c75c907fc14",
"df68f7bf4028cf7d2f32bb291a008d562eac3cad",
"testharness"
],
"bluetooth/characteristic/getDescriptor/gen-descriptor-get-same-object.https.html": [
@ -400002,15 +400002,15 @@
"testharness"
],
"bluetooth/characteristic/getDescriptor/gen-service-is-removed.https.html": [
"80c7782e7c2bba33e43d2661a3ba0d069b49e727",
"ba4c6477eaa5978599e7c77d3227bc63fe6b5a3f",
"testharness"
],
"bluetooth/characteristic/getDescriptors/gen-characteristic-is-removed-with-uuid.https.html": [
"fa068af0ac6d1629622f207b77ae95fe3f50b6cc",
"ae775a150cda67893dcace79396468134b5b8a60",
"testharness"
],
"bluetooth/characteristic/getDescriptors/gen-characteristic-is-removed.https.html": [
"82084e965ad35f176505631cb0b9007422bf3fd4",
"64c51958f8d520e9608e695ddf0115f460081f2f",
"testharness"
],
"bluetooth/characteristic/getDescriptors/gen-descriptor-get-same-object.https.html": [
@ -400018,11 +400018,11 @@
"testharness"
],
"bluetooth/characteristic/getDescriptors/gen-service-is-removed-with-uuid.https.html": [
"ad2b25c264ae236332715ae92e30452c5b97954c",
"67a1b69b198711e8c824529c2afe5513284e449f",
"testharness"
],
"bluetooth/characteristic/getDescriptors/gen-service-is-removed.https.html": [
"1132700853cbfd7fbc0772e44a407d72f710ffb5",
"e0746e2c992231bac0ed213b3f9b17a863db0902",
"testharness"
],
"bluetooth/characteristic/notifications/characteristic-is-removed.https.html": [
@ -400030,7 +400030,7 @@
"testharness"
],
"bluetooth/characteristic/notifications/service-is-removed.https.html": [
"f6a5be53c85a190dca81a9b425b63d77bc6c193f",
"c38cba83787c54f68d57f4403a0ec0242c169035",
"testharness"
],
"bluetooth/characteristic/readValue/add-multiple-event-listeners.https.html": [
@ -400046,7 +400046,7 @@
"testharness"
],
"bluetooth/characteristic/readValue/gen-characteristic-is-removed.https.html": [
"1700dfa9ba6e1aa44d42630ef7ba61d4beeed330",
"e775062bd01919af48f2c3e11ea2e90702b29064",
"testharness"
],
"bluetooth/characteristic/readValue/read-succeeds.https.html": [
@ -400058,7 +400058,7 @@
"testharness"
],
"bluetooth/characteristic/readValue/service-is-removed.https.html": [
"b79a74ccf33bc76e6582ee7c1e2f3c277f99ddfb",
"1267b87396e49b063db2a7e5fe8611ef4f39845d",
"testharness"
],
"bluetooth/characteristic/service-same-from-2-characteristics.https.html": [
@ -400070,7 +400070,7 @@
"testharness"
],
"bluetooth/characteristic/startNotifications/gen-characteristic-is-removed.https.html": [
"97f5d01743721207c5addfb9625fd3da7c0c61e3",
"471854c3309862acd121c7ef8d115b037ec297dd",
"testharness"
],
"bluetooth/characteristic/writeValue/characteristic-is-removed.https.html": [
@ -400078,11 +400078,11 @@
"testharness"
],
"bluetooth/characteristic/writeValue/gen-characteristic-is-removed.https.html": [
"62b4bd66196c9c833631916761b41e973aa2a554",
"2bad4acf374516e29cb5a259d29a97160917ec58",
"testharness"
],
"bluetooth/characteristic/writeValue/service-is-removed.https.html": [
"857ae985ba4d15bcc5d78671a7f21d990c8db9c5",
"570bba21ad98a428dd5575dc544962b8ae6a05d8",
"testharness"
],
"bluetooth/characteristic/writeValue/write-succeeds.https.html": [
@ -400090,7 +400090,7 @@
"testharness"
],
"bluetooth/descriptor/readValue/gen-service-is-removed.https.html": [
"47f1bd316ae7d2637524a1b5d4436a3f11b20fd0",
"c1954f13b95b9f5d0dbfd4f696aa0874e2a47c88",
"testharness"
],
"bluetooth/descriptor/readValue/read-succeeds.https.html": [
@ -400098,7 +400098,7 @@
"testharness"
],
"bluetooth/descriptor/writeValue/gen-service-is-removed.https.html": [
"07c2dc0a081786302040942a989cc49f6b3fa3ca",
"99c77b594dcdfa971bdf96b28c176bf2e44a98ca",
"testharness"
],
"bluetooth/device/gattserverdisconnected-event/disconnected.https.html": [
@ -400302,7 +400302,7 @@
"support"
],
"bluetooth/script-tests/characteristic/characteristic-is-removed.js": [
"7b7cd34d4c480e62fcde4667f50212cbae7f7b07",
"a82d6a1761e402906aa89a790166bccf1dd0a2c2",
"support"
],
"bluetooth/script-tests/characteristic/descriptor-get-same-object.js": [
@ -400310,11 +400310,11 @@
"support"
],
"bluetooth/script-tests/characteristic/service-is-removed.js": [
"a9fa621bca75da2887835c529b40429a20ebdff8",
"c4703192b632d2bc63609b717d5f7829aad6168e",
"support"
],
"bluetooth/script-tests/descriptor/service-is-removed.js": [
"d442ab654680a3f4c7eae6036f74a20f0b730351",
"ef6afb686e14a5b77cc88f6c51c18529739fc7ea",
"support"
],
"bluetooth/script-tests/server/disconnect-called-before.js": [
@ -400406,7 +400406,7 @@
"support"
],
"bluetooth/script-tests/service/service-is-removed.js": [
"ef77b77f70ac720b536882e9b48d7fe66fe4ecf4",
"209d46cebac1cf324dacb9741bbd7a320b70651c",
"support"
],
"bluetooth/server/connect/connection-succeeds.https.html": [
@ -400678,7 +400678,7 @@
"testharness"
],
"bluetooth/service/getCharacteristic/gen-service-is-removed.https.html": [
"9f698f4e02985f21f772d38942d7fe9f383600f0",
"8680cb14d493830e9e5ded9d4d07a6e12e2f2fee",
"testharness"
],
"bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html": [
@ -400734,11 +400734,11 @@
"testharness"
],
"bluetooth/service/getCharacteristics/gen-service-is-removed-with-uuid.https.html": [
"d8e4257645340adfd45f069c4cebbc3ca88f2348",
"b67765aaf66b9ac679e018014127836ae9a1753e",
"testharness"
],
"bluetooth/service/getCharacteristics/gen-service-is-removed.https.html": [
"417d39a317f55a95180c806d28047c85dd959d65",
"baadfc8451547b9b1a863b222009f230fc2b032b",
"testharness"
],
"clear-site-data/navigation-insecure.html": [

Просмотреть файл

@ -17,6 +17,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.getDescriptor(user_description.name), expected)),

Просмотреть файл

@ -17,6 +17,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.getDescriptor(user_description.name),

Просмотреть файл

@ -17,6 +17,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.getDescriptors(user_description.name), expected)),

Просмотреть файл

@ -17,6 +17,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.getDescriptors(), expected)),

Просмотреть файл

@ -17,6 +17,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.getDescriptors(user_description.uuid),

Просмотреть файл

@ -17,6 +17,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.getDescriptors(user_description.name),

Просмотреть файл

@ -14,6 +14,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.startNotifications(),

Просмотреть файл

@ -17,6 +17,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.readValue(), expected)),

Просмотреть файл

@ -14,6 +14,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.readValue(),

Просмотреть файл

@ -17,6 +17,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.startNotifications(), expected)),

Просмотреть файл

@ -17,6 +17,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.writeValue(new Uint8Array(1)), expected)),

Просмотреть файл

@ -14,6 +14,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.writeValue(new ArrayBuffer(1 /* length */)),

Просмотреть файл

@ -15,6 +15,7 @@ let descriptor, fake_peripheral, fake_service;
bluetooth_test(() => getUserDescriptionDescriptor()
.then(_ => ({descriptor, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
descriptor.readValue(),

Просмотреть файл

@ -15,6 +15,7 @@ let descriptor, fake_peripheral, fake_service;
bluetooth_test(() => getUserDescriptionDescriptor()
.then(_ => ({descriptor, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
descriptor.writeValue(new ArrayBuffer(1 /* length */)),

Просмотреть файл

@ -9,6 +9,7 @@ bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(() => characteristic.getDescriptor(user_description.name))
.then(() => null, (e) => assert_unreached('Caught error unexpectedly.', e))
.then(() => fake_characteristic.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.CALLS([

Просмотреть файл

@ -9,6 +9,7 @@ let characteristic, fake_peripheral, fake_service;
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(_ => ({characteristic, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
characteristic.CALLS([

Просмотреть файл

@ -7,6 +7,7 @@ let descriptor, fake_peripheral, fake_service;
bluetooth_test(() => getUserDescriptionDescriptor()
.then(_ => ({descriptor, fake_peripheral, fake_service} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
descriptor.CALLS([

Просмотреть файл

@ -8,6 +8,7 @@ let service, fake_service, fake_peripheral;
bluetooth_test(() => getHealthThermometerService()
.then(_ => ({service, fake_service, fake_peripheral} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
service.CALLS([

Просмотреть файл

@ -16,6 +16,7 @@ let service, fake_service, fake_peripheral;
bluetooth_test(() => getHealthThermometerService()
.then(_ => ({service, fake_service, fake_peripheral} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
service.getCharacteristic('measurement_interval'),

Просмотреть файл

@ -16,6 +16,7 @@ let service, fake_service, fake_peripheral;
bluetooth_test(() => getHealthThermometerService()
.then(_ => ({service, fake_service, fake_peripheral} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
service.getCharacteristics('measurement_interval'),

Просмотреть файл

@ -16,6 +16,7 @@ let service, fake_service, fake_peripheral;
bluetooth_test(() => getHealthThermometerService()
.then(_ => ({service, fake_service, fake_peripheral} = _))
.then(() => fake_service.remove())
.then(() => fake_peripheral.setNextGATTDiscoveryResponse({HCI_SUCCESS}))
.then(() => fake_peripheral.simulateGATTServicesChanged())
.then(() => assert_promise_rejects_with_message(
service.getCharacteristics(),