Commit 4074d0f4 authored by Ovidio Henriquez's avatar Ovidio Henriquez Committed by Commit Bot

bluetooth: web: test: Update characteristic same object tests

This change updates a couple of characteristic same object tests to use
the new test API. This will allow the tests to be migrated into the wpt/
directory.

BUG=509038

Change-Id: I483a623c8f58848fb0a7e3cea7cb65b27c79eccc
Reviewed-on: https://chromium-review.googlesource.com/823072
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarConley Owens <cco3@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532060}
parent 746a8c15
...@@ -7,17 +7,14 @@ ...@@ -7,17 +7,14 @@
<script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script> <script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script>
<script> <script>
'use strict'; 'use strict';
bluetooth_test(() => { const test_desc = 'Same parent service returned from multiple characteristics.';
return setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => requestDeviceWithTrustedClick({ bluetooth_test(() => getHealthThermometerService()
filters: [{services: ['heart_rate']}]})) .then(({service}) => Promise.all([
.then(device => device.gatt.connect()) service.getCharacteristic('measurement_interval'),
.then(gattServer => gattServer.getPrimaryService('heart_rate')) service.getCharacteristic('temperature_measurement')
.then(service => { ]))
return Promise.all([service.getCharacteristic('body_sensor_location'), .then(characteristics =>
service.getCharacteristic('heart_rate_measurement')]); assert_equals(characteristics[0].service, characteristics[1].service)),
}).then(characteristics => { test_desc);
assert_equals(characteristics[0].service, characteristics[1].service);
});
}, "Same parent service returned from multiple characteristics.");
</script> </script>
...@@ -7,15 +7,11 @@ ...@@ -7,15 +7,11 @@
<script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script> <script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script>
<script> <script>
'use strict'; 'use strict';
bluetooth_test(() => { const test_desc = '[SameObject] test for BluetoothRemoteGATTCharacteristic ' +
return setBluetoothFakeAdapter('HeartRateAdapter') 'service.';
.then(() => requestDeviceWithTrustedClick({
filters: [{services: ['heart_rate']}]})) bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(device => device.gatt.connect()) .then(({characteristic}) =>
.then(gattServer => gattServer.getPrimaryService('heart_rate')) assert_equals(characteristic.service, characteristic.service)),
.then(service => service.getCharacteristic('body_sensor_location')) test_desc);
.then(characteristic => {
assert_equals(characteristic.service, characteristic.service);
});
}, "[SameObject] test for BluetoothRemoteGATTCharacteristic's service.");
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment