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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/server/getPrimaryServices/gen-device-disconnects-invalidates-objects.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
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> 6 <script>
7 'use strict'; 7 'use strict';
8 promise_test(() => { 8 promise_test(() => {
9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') 9 return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
10 .then(() => requestDeviceWithKeyDown({ 10 .then(() => requestDeviceWithKeyDown({
(...skipping 13 matching lines...) Expand all
24 .then(() => gattServer.connect()) 24 .then(() => gattServer.connect())
25 .then(() => services); 25 .then(() => services);
26 }) 26 })
27 .then(services => { 27 .then(services => {
28 let promises = Promise.resolve(); 28 let promises = Promise.resolve();
29 for (let service of services) { 29 for (let service of services) {
30 if (service.uuid == request_disconnection_service_uuid) { 30 if (service.uuid == request_disconnection_service_uuid) {
31 continue; 31 continue;
32 } 32 }
33 let error = new DOMException( 33 let error = new DOMException(
34 'Service is no longer valid. Remember to retrieve the service ' + 34 'Service with UUID ' + service.uuid +
35 ' is no longer valid. Remember to retrieve the service ' +
35 'again after reconnecting.', 36 'again after reconnecting.',
36 'InvalidStateError'); 37 'InvalidStateError');
37 promises = promises.then(() => 38 promises = promises.then(() =>
38 assert_promise_rejects_with_message( 39 assert_promise_rejects_with_message(
39 service.getCharacteristic('measurement_interval'), 40 service.getCharacteristic('measurement_interval'),
40 error)); 41 error));
41 promises = promises.then(() => 42 promises = promises.then(() =>
42 assert_promise_rejects_with_message( 43 assert_promise_rejects_with_message(
43 service.getCharacteristics(), 44 service.getCharacteristics(),
44 error)); 45 error));
45 promises = promises.then(() => 46 promises = promises.then(() =>
46 assert_promise_rejects_with_message( 47 assert_promise_rejects_with_message(
47 service.getCharacteristics('measurement_interval'), 48 service.getCharacteristics('measurement_interval'),
48 error)); 49 error));
49 } 50 }
50 return promises; 51 return promises;
51 }); 52 });
52 }, 'Calls on services after device disconnects and we reconnect. ' + 53 }, 'Calls on services after device disconnects and we reconnect. ' +
53 'Should reject with InvalidStateError.'); 54 'Should reject with InvalidStateError.');
54 55
55 </script> 56 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698