| 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(() => { | |
| 8 return setBluetoothFakeAdapter('HeartRateAdapter') | |
| 9 .then(() => requestDeviceWithKeyDown({ | |
| 10 filters: [{services: ['heart_rate']}], | |
| 11 optionalServices: ['generic_access']})) | |
| 12 .then(device => device.gatt.connect()) | |
| 13 .then(gattServer => gattServer.getPrimaryService('generic_access')) | |
| 14 .then(services => Promise.all([ | |
| 15 services.getCharacteristic('gap.device_name'), | |
| 16 services.getCharacteristic('gap.device_name')])) | |
| 17 .then(characteristics => { | |
| 18 // TODO(ortuno): getCharacteristic should return the same object | |
| 19 // if it was created earlier. | |
| 20 // https://crbug.com/495270 | |
| 21 for (var i = 1; i < characteristics.length; i++) { | |
| 22 assert_not_equals( | |
| 23 characteristics[0], characteristics[i], | |
| 24 'Should return the same characteristic as the first call.'); | |
| 25 } | |
| 26 }); | |
| 27 }, 'Calls to get the same characteristic should return the same object.'); | |
| 28 </script> | |
| OLD | NEW |