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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/script-tests/descriptor-invalid-name.js

Issue 2466223002: Implement WebBluetooth getDescriptor[s] (Closed)
Patch Set: Rebase Created 4 years 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
(Empty)
1 'use strict';
2 promise_test(() => {
3 let promise;
4 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
5 .then(() => requestDeviceWithKeyDown({
6 filters: [{services: ['health_thermometer']}]}))
7 .then(device => device.gatt.connect())
8 .then(gattServer => gattServer.getPrimaryService('health_thermometer'))
9 .then(service => service.getCharacteristic('measurement_interval'))
10
ortuno 2016/12/02 06:14:50 nit: remote blank line.
dougt 2016/12/02 18:31:28 Done.
11 .then(characteristic => {
12 promise = assert_promise_rejects_with_message(
ortuno 2016/12/02 06:14:50 You can just return the promise. No need to save i
dougt 2016/12/02 18:31:28 Done.
13 characteristic.CALLS([
14 getDescriptor('invalid-name')|
15 getDescriptors('invalid-name')]),
16 new DOMException(
17 'Failed to execute \'FUNCTION_NAME\' on ' +
18 '\'BluetoothRemoteGATTCharacteristic\': Invalid Descriptor nam e: ' +
19 '\'invalid-name\'. ' +
20 'It must be a valid UUID alias (e.g. 0x1234), ' +
21 'UUID (lowercase hex characters e.g. ' +
22 '\'00001234-0000-1000-8000-00805f9b34fb\'), ' +
23 'or recognized standard name from ' +
24 'https://developer.bluetooth.org/gatt/descriptors/' +
25 'Pages/DescriptorsHomePage.aspx' +
26 ' e.g. \'gatt.characteristic_presentation_format\'.',
27 'TypeError'));
28 // Disconnect called to clear attributeInstanceMap and allow the
29 // object to get garbage collected.
30 characteristic.service.device.gatt.disconnect();
ortuno 2016/12/02 06:14:50 No need to disconnect.
dougt 2016/12/02 18:31:28 Done.
31 })
32 .then(runGarbageCollection)
33 .then(() => promise);
34 }, 'Garbage Collection ran during a FUNCTION_NAME call that succeeds. ' +
35 'Should not crash.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698