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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.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 'use strict'; 6 'use strict';
7 promise_test(() => { 7 promise_test(() => {
8 let name_too_long = generate_string(249, 'a'); 8 let name_too_long = 'a'.repeat(249);
9 return assert_promise_rejects_with_message( 9 return assert_promise_rejects_with_message(
10 requestDeviceWithKeyDown({filters: [{namePrefix: name_too_long}]}), 10 requestDeviceWithKeyDown({filters: [{namePrefix: name_too_long}]}),
11 new DOMException( 11 new DOMException(
12 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' + 12 'Failed to execute \'requestDevice\' on \'Bluetooth\': ' +
13 'A device name can\'t be longer than 248 bytes.', 13 'A device name can\'t be longer than 248 bytes.',
14 'TypeError'), 14 'TypeError'),
15 'Device name prefix longer than 248'); 15 'Device name prefix longer than 248');
16 }, 'A device name prefix longer than 248 must reject.'); 16 }, 'A device name prefix longer than 248 must reject.');
17 </script> 17 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698