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/mojo-helpers.js"></script> |
| 6 <script src="../../../resources/bluetooth/web-bluetooth-test.js"></script> |
5 <script> | 7 <script> |
6 promise_test(() => { | 8 promise_test(() => { |
7 let valid_unicode_name = generate_string( | 9 let valid_unicode_name = generate_string( |
8 9, '\u2764'); // \u2764's UTF-8 representation is 3 bytes long. | 10 9, '\u2764'); // \u2764's UTF-8 representation is 3 bytes long. |
9 // 9 chars * 3 bytes/char = 27 bytes | 11 // 9 chars * 3 bytes/char = 27 bytes |
10 return setBluetoothFakeAdapter('UnicodeDeviceAdapter') | 12 return setUpSystemConnectedDevice({name: valid_unicode_name}) |
11 .then(() => requestDeviceWithKeyDown({ | 13 .then(() => requestDeviceWithKeyDown({ |
12 filters: [{name: valid_unicode_name}]})) | 14 filters: [{name: valid_unicode_name}]})) |
13 .then(device => { | 15 .then(device => { |
14 assert_equals(device.name, valid_unicode_name); | 16 assert_equals(device.name, valid_unicode_name); |
15 }); | 17 }); |
16 }, 'A name containing unicode characters whose utf8 length is less than 30 ' + | 18 }, 'A name containing unicode characters whose utf8 length is less than 30 ' + |
17 'must not throw an error.'); | 19 'must not throw an error.'); |
18 </script> | 20 </script> |
OLD | NEW |