Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.html

Issue 2858183002: bluetooth: Use String.repeat directly instead of generate_string. (Closed)
Patch Set: Merge branch 'bluetooth-simulate-preconnected' into bluetooth-simulateconnecteddevice-followup Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 5 <script src="../../../resources/mojo-helpers.js"></script>
6 <script src="../../../resources/bluetooth/web-bluetooth-test.js"></script> 6 <script src="../../../resources/bluetooth/web-bluetooth-test.js"></script>
7 <script> 7 <script>
8 promise_test(() => { 8 promise_test(() => {
9 let valid_unicode_name = generate_string( 9 // \u2764's UTF-8 representation is 3 bytes long.
10 9, '\u2764'); // \u2764's UTF-8 representation is 3 bytes long. 10 // 9 chars * 3 bytes/char = 27 bytes
11 // 9 chars * 3 bytes/char = 27 bytes 11 let valid_unicode_name = '\u2764'.repeat(9);
12 return setUpPreconnectedDevice({name: valid_unicode_name}) 12 return setUpPreconnectedDevice({name: valid_unicode_name})
13 .then(() => requestDeviceWithKeyDown({ 13 .then(() => requestDeviceWithKeyDown({
14 filters: [{name: valid_unicode_name}]})) 14 filters: [{name: valid_unicode_name}]}))
15 .then(device => { 15 .then(device => {
16 assert_equals(device.name, valid_unicode_name); 16 assert_equals(device.name, valid_unicode_name);
17 }); 17 });
18 }, '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 ' +
19 'must not throw an error.'); 19 'must not throw an error.');
20 </script> 20 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698