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 @@
<script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script>
<script>
'use strict';
bluetooth_test(() => {
return setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => requestDeviceWithTrustedClick({
filters: [{services: ['heart_rate']}]}))
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService('heart_rate'))
.then(service => {
return Promise.all([service.getCharacteristic('body_sensor_location'),
service.getCharacteristic('heart_rate_measurement')]);
}).then(characteristics => {
assert_equals(characteristics[0].service, characteristics[1].service);
});
}, "Same parent service returned from multiple characteristics.");
const test_desc = 'Same parent service returned from multiple characteristics.';
bluetooth_test(() => getHealthThermometerService()
.then(({service}) => Promise.all([
service.getCharacteristic('measurement_interval'),
service.getCharacteristic('temperature_measurement')
]))
.then(characteristics =>
assert_equals(characteristics[0].service, characteristics[1].service)),
test_desc);
</script>
......@@ -7,15 +7,11 @@
<script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script>
<script>
'use strict';
bluetooth_test(() => {
return setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => requestDeviceWithTrustedClick({
filters: [{services: ['heart_rate']}]}))
.then(device => device.gatt.connect())
.then(gattServer => gattServer.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('body_sensor_location'))
.then(characteristic => {
assert_equals(characteristic.service, characteristic.service);
});
}, "[SameObject] test for BluetoothRemoteGATTCharacteristic's service.");
const test_desc = '[SameObject] test for BluetoothRemoteGATTCharacteristic ' +
'service.';
bluetooth_test(() => getMeasurementIntervalCharacteristic()
.then(({characteristic}) =>
assert_equals(characteristic.service, characteristic.service)),
test_desc);
</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