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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-device-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> 5 <script>
6 promise_test(() => { 6 promise_test(() => {
7 // \u2764's UTF-8 respresentation is 3 bytes long. 7 // \u2764's UTF-8 respresentation is 3 bytes long.
8 // 83 chars * 3 bytes/char = 249 bytes 8 // 83 chars * 3 bytes/char = 249 bytes
9 const unicode_name = generate_string(83, '\u2764'); 9 const unicode_name = '\u2764'.repeat(83);
10 return assert_promise_rejects_with_message( 10 return assert_promise_rejects_with_message(
11 requestDeviceWithKeyDown({filters: [{name: unicode_name}]}), 11 requestDeviceWithKeyDown({filters: [{name: unicode_name}]}),
12 new DOMException( 12 new DOMException(
13 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' + 13 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' +
14 'A device name can\'t be longer than 248 bytes.', 14 'A device name can\'t be longer than 248 bytes.',
15 'TypeError')); 15 'TypeError'));
16 }, 'Unicode string with utf8 representation longer than 248 bytes in ' + 16 }, 'Unicode string with utf8 representation longer than 248 bytes in ' +
17 '\'name\' must throw TypeError.'); 17 '\'name\' must throw TypeError.');
18 </script> 18 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698