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

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

Issue 2858803003: bluetooth: Implement simulatePreconnectedPeripheral. (Closed)
Patch Set: Merge branch 'master' into bluetooth-simulate-preconnected 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>
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 setUpPreconnectedDevice({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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698