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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/server/getPrimaryService/gen-invalid-service-name.html

Issue 2874873003: bluetooth: Implement simulateGATTConnectionResponse() (Closed)
Patch Set: fix Created 3 years, 6 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 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py --> 1 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py -->
2 <!DOCTYPE html> 2 <!DOCTYPE html>
3 <script src="../../../resources/testharness.js"></script> 3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script> 4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> 5 <script src="../../../resources/bluetooth/bluetooth-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 src="../../../resources/mojo-helpers.js"></script> 7 <script src="../../../resources/mojo-helpers.js"></script>
8 <script> 8 <script>
9 'use strict'; 9 'use strict';
10 promise_test(() => { 10 promise_test(() => {
11 return setBluetoothFakeAdapter('HeartRateAdapter') 11 return getHealthThermometerDevice()
12 .then(() => requestDeviceWithKeyDown({ 12 .then(([device]) => {
13 filters: [{services: ['heart_rate']}]}))
14 .then(device => device.gatt.connect())
15 .then(gatt => {
16 return assert_promise_rejects_with_message( 13 return assert_promise_rejects_with_message(
17 gatt.getPrimaryService('wrong_name'), 14 device.gatt.getPrimaryService('wrong_name'),
18 new DOMException( 15 new DOMException(
19 'Failed to execute \'getPrimaryService\' on ' + 16 'Failed to execute \'getPrimaryService\' on ' +
20 '\'BluetoothRemoteGATTServer\': Invalid Service name: ' + 17 '\'BluetoothRemoteGATTServer\': Invalid Service name: ' +
21 '\'wrong_name\'. ' + 18 '\'wrong_name\'. ' +
22 'It must be a valid UUID alias (e.g. 0x1234), ' + 19 'It must be a valid UUID alias (e.g. 0x1234), ' +
23 'UUID (lowercase hex characters e.g. ' + 20 'UUID (lowercase hex characters e.g. ' +
24 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' + 21 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' +
25 'or recognized standard name from ' + 22 'or recognized standard name from ' +
26 'https://www.bluetooth.com/specifications/gatt/services' + 23 'https://www.bluetooth.com/specifications/gatt/services' +
27 ' e.g. \'alert_notification\'.', 24 ' e.g. \'alert_notification\'.',
28 'TypeError'), 25 'TypeError'),
29 'Wrong Service name passed.'); 26 'Wrong Service name passed.');
30 }); 27 });
31 }, 'Wrong Service name. Reject with TypeError.'); 28 }, 'Wrong Service name. Reject with TypeError.');
32 29
33 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698