| <!DOCTYPE html> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| <script src="../../../resources/mojo-helpers.js"></script> |
| <script src="../../../resources/bluetooth/web-bluetooth-test.js"></script> |
| <script> |
| promise_test(() => { |
| // \u2764's UTF-8 representation is 3 bytes long. |
| // 9 chars * 3 bytes/char = 27 bytes |
| let valid_unicode_name = '\u2764'.repeat(9); |
| return setUpPreconnectedDevice({name: valid_unicode_name}) |
| .then(() => requestDeviceWithKeyDown({ |
| filters: [{name: valid_unicode_name}]})) |
| .then(device => { |
| assert_equals(device.name, valid_unicode_name); |
| }); |
| }, 'A name containing unicode characters whose utf8 length is less than 30 ' + |
| 'must not throw an error.'); |
| </script> |