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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/script-tests/server/garbage-collection-ran-during-error.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(() => { 2 promise_test(() => {
3 let promise; 3 let promise;
4 return setBluetoothFakeAdapter('MissingServiceHeartRateAdapter') 4 return setBluetoothFakeAdapter('MissingServiceHeartRateAdapter')
5 .then(() => requestDeviceWithKeyDown({ 5 .then(
6 filters: [{services: ['heart_rate']}]})) 6 () =>
7 .then(device => device.gatt.connect()) 7 requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}))
8 .then(gattServer => { 8 .then(device => device.gatt.connect())
9 promise = assert_promise_rejects_with_message( 9 .then(gattServer => {
10 gattServer.CALLS([ 10 promise = assert_promise_rejects_with_message(
11 getPrimaryService('heart_rate')| 11 gattServer.CALLS(
12 getPrimaryServices()| 12 [getPrimaryService('heart_rate') | getPrimaryServices() |
13 getPrimaryServices('heart_rate')[UUID]]), 13 getPrimaryServices('heart_rate')[UUID]]),
14 new DOMException( 14 new DOMException(
15 'GATT Server disconnected while retrieving services.', 15 'GATT Server is disconnected. ' +
16 'NetworkError')); 16 'Cannot retrieve services. ' +
17 // Disconnect called to clear attributeInstanceMap and allow the 17 '(Re)connect first with `device.gatt.connect`.',
18 // object to get garbage collected. 18 'NetworkError'));
19 gattServer.disconnect(); 19 // Disconnect called to clear attributeInstanceMap and allow the
20 }) 20 // object to get garbage collected.
21 .then(runGarbageCollection) 21 gattServer.disconnect();
22 .then(() => promise); 22 })
23 .then(runGarbageCollection)
24 .then(() => promise);
23 }, 'Garbage Collection ran during a FUNCTION_NAME call that failed. ' + 25 }, 'Garbage Collection ran during a FUNCTION_NAME call that failed. ' +
24 'Should not crash.'); 26 'Should not crash.');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698