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

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

Issue 2423853002: bluetooth: Add script to generate tests based on templates (Closed)
Patch Set: Remove replace loop Created 4 years, 2 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 | « third_party/WebKit/LayoutTests/bluetooth/script-tests/base_test_template.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 'use strict';
2 promise_test(t => {
3 return setBluetoothFakeAdapter('DisconnectingHeartRateAdapter')
4 .then(() => requestDeviceWithKeyDown({
5 filters: [{services: ['heart_rate']}],
6 optionalServices: [request_disconnection_service_uuid]
7 }))
8 .then(device => {
9 return device.gatt.connect()
10 .then(gattServer => gattServer.getPrimaryService(
11 request_disconnection_service_uuid))
12 .then(service => service.getCharacteristic(
13 request_disconnection_characteristic_uuid))
14 .then(requestDisconnection => requestDisconnection.writeValue(
15 new Uint8Array([0])))
16 .then(() => assert_promise_rejects_with_message(
17 device.gatt.CALLS([
18 getPrimaryService('heart_rate')|
19 getPrimaryServices()|
20 getPrimaryServices('heart_rate')[UUID]]),
21 new DOMException(
22 'GATT Server is disconnected. Cannot retrieve services.',
23 'NetworkError')));
24 });
25 }, 'Device disconnects before FUNCTION_NAME. Reject with NetworkError.');
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/bluetooth/script-tests/base_test_template.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698