| 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 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, | 8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, |
| 9 'window.testRunner is required for the following tests.'); | 9 'window.testRunner is required for the following tests.'); |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 testRunner.setBluetoothMockDataSet('GenericAccessAdapter'); | 102 testRunner.setBluetoothMockDataSet('GenericAccessAdapter'); |
| 103 return requestDeviceWithKeyDown({filters: [{services: ['generic_access']}]}) | 103 return requestDeviceWithKeyDown({filters: [{services: ['generic_access']}]}) |
| 104 .then(device => device.connectGATT()) | 104 .then(device => device.connectGATT()) |
| 105 .then(gattServer => gattServer.getPrimaryService('generic_access')) | 105 .then(gattServer => gattServer.getPrimaryService('generic_access')) |
| 106 .then(service => { | 106 .then(service => { |
| 107 return assert_promise_rejects_with_message( | 107 return assert_promise_rejects_with_message( |
| 108 service.getCharacteristic('wrong_name'), { | 108 service.getCharacteristic('wrong_name'), { |
| 109 name: 'SyntaxError', | 109 name: 'SyntaxError', |
| 110 message: 'Failed to execute \'getCharacteristic\' on ' + | 110 message: 'Failed to execute \'getCharacteristic\' on ' + |
| 111 '\'BluetoothGATTService\': \Invalid Characteristic name: ' + | 111 '\'BluetoothGATTService\': \Invalid Characteristic name: ' + |
| 112 '\'wrong_name\'.' | 112 '\'wrong_name\'. ' + |
| 113 'It must be a valid UUID alias (e.g. 0x1234), ' + |
| 114 'UUID (lowercase hex characters e.g. ' + |
| 115 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' + |
| 116 'or recognized standard name from ' + |
| 117 'https://developer.bluetooth.org/gatt/characteristics/Pages/C
haracteristicsHome.aspx' + |
| 118 ' e.g. \'aerobic_heart_rate_lower_limit\'.' |
| 113 }, 'Wrong Characteristic name passed.'); | 119 }, 'Wrong Characteristic name passed.'); |
| 114 }); | 120 }); |
| 115 }, 'Wrong Characteristic name. Reject with SyntaxError.'); | 121 }, 'Wrong Characteristic name. Reject with SyntaxError.'); |
| 116 </script> | 122 </script> |
| OLD | NEW |