| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script> | 4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script> |
| 5 <script src="../../resources/bluetooth/web-bluetooth-test.js"></script> |
| 6 <script src="../../resources/mojo-helpers.js"></script> |
| 5 <script> | 7 <script> |
| 6 test(() => { | 8 test(() => { |
| 7 assert_throws(null, () => new BluetoothDevice(), | 9 assert_throws(null, () => new BluetoothDevice(), |
| 8 'the constructor should not be callable with "new"'); | 10 'the constructor should not be callable with "new"'); |
| 9 assert_throws(null, () => BluetoothDevice(), | 11 assert_throws(null, () => BluetoothDevice(), |
| 10 'the constructor should not be callable'); | 12 'the constructor should not be callable'); |
| 11 }, 'BluetoothDevice IDL test'); | 13 }, 'BluetoothDevice IDL test'); |
| 12 | 14 |
| 13 promise_test(() => { | 15 promise_test(() => { |
| 14 return setBluetoothFakeAdapter('GlucoseHeartRateAdapter') | 16 return setUpHealthThermometerAndHeartRateDevices() |
| 15 .then(() => requestDeviceWithKeyDown({ | 17 .then(() => requestDeviceWithKeyDown({ |
| 16 filters: [{services: ['heart_rate']}]})) | 18 filters: [{services: ['heart_rate']}]})) |
| 17 .then(device => { | 19 .then(device => { |
| 18 assert_equals(device.constructor.name, 'BluetoothDevice'); | 20 assert_equals(device.constructor.name, 'BluetoothDevice'); |
| 19 | 21 |
| 20 // Attempt (and fail) to overwrite all members, verifying they are | 22 // Attempt (and fail) to overwrite all members, verifying they are |
| 21 // readonly. | 23 // readonly. |
| 22 var old_device_id = device.id; | 24 var old_device_id = device.id; |
| 23 device.id = 'overwritten'; | 25 device.id = 'overwritten'; |
| 24 device.name = 'overwritten'; | 26 device.name = 'overwritten'; |
| 25 assert_equals(device.id, old_device_id); | 27 assert_equals(device.id, old_device_id); |
| 26 assert_equals(device.name, 'Heart Rate Device'); | 28 assert_equals(device.name, 'Heart Rate'); |
| 27 }); | 29 }); |
| 28 }, 'BluetoothDevice attributes.'); | 30 }, 'BluetoothDevice attributes.'); |
| 29 </script> | 31 </script> |
| OLD | NEW |