| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script> | |
| 5 <script> | |
| 6 'use strict'; | |
| 7 promise_test(function() { | |
| 8 return setBluetoothFakeAdapter('HeartRateAdapter') | |
| 9 .then(() => requestDeviceWithKeyDown({ | |
| 10 filters: [{services: ['heart_rate']}], | |
| 11 optionalServices: ['generic_access']})) | |
| 12 .then(device => { | |
| 13 return device.gatt.connect() | |
| 14 .then(gattServer => Promise.all([ | |
| 15 gattServer.getPrimaryService(generic_access.alias), | |
| 16 gattServer.getPrimaryService(generic_access.name), | |
| 17 gattServer.getPrimaryService(generic_access.uuid)])) | |
| 18 .then(services => { | |
| 19 services.forEach(service => { | |
| 20 assert_equals(service.uuid, generic_access.uuid, | |
| 21 'Service UUID should be the same as requested UUID.'); | |
| 22 assert_true(service.isPrimary, | |
| 23 'getPrimaryService should return a primary service.'); | |
| 24 assert_equals(service.device, device, | |
| 25 'Service device should be the same as device.'); | |
| 26 }); | |
| 27 }); | |
| 28 }); | |
| 29 }, 'Request for service. Should return right service'); | |
| 30 </script> | |
| OLD | NEW |