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-helpers.js"></script> | 4 <script src="resources/bluetooth-helpers.js"></script> |
5 <script> | 5 <script> |
6 test(() => { | 6 test(() => { |
7 assert_throws(null, () => new BluetoothDevice(), | 7 assert_throws(null, () => new BluetoothDevice(), |
8 'the constructor should not be callable with "new"'); | 8 'the constructor should not be callable with "new"'); |
9 assert_throws(null, () => BluetoothDevice(), | 9 assert_throws(null, () => BluetoothDevice(), |
10 'the constructor should not be callable'); | 10 'the constructor should not be callable'); |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Attempt (and fail) to overwrite all members, verifying they are | 22 // Attempt (and fail) to overwrite all members, verifying they are |
23 // readonly. | 23 // readonly. |
24 device.id = 'overwritten'; | 24 device.id = 'overwritten'; |
25 device.name = 'overwritten'; | 25 device.name = 'overwritten'; |
26 device.deviceClass = 'overwritten'; | 26 device.deviceClass = 'overwritten'; |
27 device.vendorIDSource = 'overwritten'; | 27 device.vendorIDSource = 'overwritten'; |
28 device.vendorID = 'overwritten'; | 28 device.vendorID = 'overwritten'; |
29 device.productID = 'overwritten'; | 29 device.productID = 'overwritten'; |
30 device.productVersion = 'overwritten'; | 30 device.productVersion = 'overwritten'; |
31 device.paired = 'overwritten'; | |
32 device.uuids = 'overwritten'; | 31 device.uuids = 'overwritten'; |
33 assert_equals(device.id, '00:00:00:00:00:00'); | 32 assert_equals(device.id, '00:00:00:00:00:00'); |
34 assert_equals(device.name, 'Heart Rate Device'); | 33 assert_equals(device.name, 'Heart Rate Device'); |
35 assert_equals(device.deviceClass, 0x1F00); | 34 assert_equals(device.deviceClass, 0x1F00); |
36 assert_equals(device.vendorIDSource, 'bluetooth'); | 35 assert_equals(device.vendorIDSource, 'bluetooth'); |
37 assert_equals(device.vendorID, 0xFFFF); | 36 assert_equals(device.vendorID, 0xFFFF); |
38 assert_equals(device.productID, 1); | 37 assert_equals(device.productID, 1); |
39 assert_equals(device.productVersion, 2); | 38 assert_equals(device.productVersion, 2); |
40 assert_equals(device.paired, true); | |
41 assert_equals(device.uuids.length, 1); | 39 assert_equals(device.uuids.length, 1); |
42 assert_equals(device.uuids[0], heart_rate.uuid); | 40 assert_equals(device.uuids[0], heart_rate.uuid); |
43 }); | 41 }); |
44 }, 'BluetoothDevice attributes.'); | 42 }, 'BluetoothDevice attributes.'); |
45 </script> | 43 </script> |
OLD | NEW |