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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/characteristic/getDescriptor/descriptor-not-found.html

Issue 2680783002: bluetooth: show better error messages for services, characteristics and descriptors (Closed)
Patch Set: Added comment and changed to enum class. Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/bluetooth/script-tests/server/device-disconnects-invalidates-objects.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 let descriptorUUID = '00002906-0000-1000-8000-00805f9b34fb';
7 promise_test(() => { 8 promise_test(() => {
8 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') 9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
9 .then(() => requestDeviceWithKeyDown({ 10 .then(() => requestDeviceWithKeyDown({
10 filters: [{services: ['health_thermometer']}]})) 11 filters: [{services: ['health_thermometer']}]}))
11 .then(device => device.gatt.connect()) 12 .then(device => device.gatt.connect())
12 .then(gattServer => gattServer.getPrimaryService('health_thermometer')) 13 .then(gattServer => gattServer.getPrimaryService('health_thermometer'))
13 .then(service => service.getCharacteristic('measurement_interval')) 14 .then(service => service.getCharacteristic('measurement_interval'))
14 .then(characteristic => { 15 .then(characteristic => {
15 assert_promise_rejects_with_message( 16 return assert_promise_rejects_with_message(
16 // Valid Range is not present in this characteristic 17 // Valid Range is not present in this characteristic
17 characteristic.getDescriptor(2906), 18 characteristic.getDescriptor(descriptorUUID),
18 new DOMException( 19 new DOMException(
19 'No Descriptors with specified UUID found in Characteristic.', 20 'No Descriptors matching UUID ' + descriptorUUID +
21 ' found in Characteristic with UUID ' + measurement_interval.uuid + '. ',
20 'NotFoundError')); 22 'NotFoundError'));
21 }) 23 })
22 }, 'Request for absent descriptor. Reject with NotFoundError.'); 24 }, 'Request for absent descriptor. Reject with NotFoundError.');
23 </script> 25 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/bluetooth/script-tests/server/device-disconnects-invalidates-objects.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698