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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/script-tests/server/device-disconnects-before.js

Issue 2652163002: bluetooth: Improve GATT disconnected error message. (Closed)
Patch Set: Merge TOT Created 3 years, 10 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 'use strict'; 1 'use strict';
2 promise_test(t => { 2 promise_test(t => {
3 return setBluetoothFakeAdapter('DisconnectingHeartRateAdapter') 3 return setBluetoothFakeAdapter('DisconnectingHeartRateAdapter')
4 .then(() => requestDeviceWithKeyDown({ 4 .then(() => requestDeviceWithKeyDown({
5 filters: [{services: ['heart_rate']}], 5 filters: [{services: ['heart_rate']}],
6 optionalServices: [request_disconnection_service_uuid] 6 optionalServices: [request_disconnection_service_uuid]
7 })) 7 }))
8 .then(device => { 8 .then(device => {
9 return device.gatt.connect() 9 return device.gatt.connect()
10 .then(gattServer => get_request_disconnection(gattServer)) 10 .then(gattServer => get_request_disconnection(gattServer))
11 .then(requestDisconnection => requestDisconnection()) 11 .then(requestDisconnection => requestDisconnection())
12 .then(() => assert_promise_rejects_with_message( 12 .then(
13 device.gatt.CALLS([ 13 () => assert_promise_rejects_with_message(
14 getPrimaryService('heart_rate')| 14 device.gatt.CALLS(
15 getPrimaryServices()| 15 [getPrimaryService('heart_rate') |
16 getPrimaryServices('heart_rate')[UUID]]), 16 getPrimaryServices() |
17 new DOMException( 17 getPrimaryServices('heart_rate')[UUID]]),
18 'GATT Server is disconnected. Cannot retrieve services.', 18 new DOMException(
19 'NetworkError'))); 19 'GATT Server is disconnected. ' +
20 }); 20 'Cannot retrieve services. ' +
21 '(Re)connect first with `device.gatt.connect`.',
22 'NetworkError')));
23 });
21 }, 'Device disconnects before FUNCTION_NAME. Reject with NetworkError.'); 24 }, 'Device disconnects before FUNCTION_NAME. Reject with NetworkError.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698