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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-disconnect-invalidates-objects-with-uuid.html

Issue 2544513004: Fix WebBluetooth generator to distinguish between different methods. (Closed)
Patch Set: Remove TL;DR in README Created 4 years 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
(Empty)
1 <!-- Generated by //third_party/WebKit/LayoutTests/bluetooth/generate.py -->
2 <!DOCTYPE html>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script>
6 <script>
7 'use strict';
8 promise_test(() => {
9 let promise;
10 return setBluetoothFakeAdapter('TwoHeartRateServicesAdapter')
11 .then(() => requestDeviceWithKeyDown({
12 filters: [{services: ['heart_rate']}]}))
13 .then(device => device.gatt.connect())
14 .then(gattServer => {
15 return gattServer
16 .getPrimaryServices('heart_rate')
17 // Convert to array if necessary.
18 .then(s => {
19 let services = [].concat(s);
20 gattServer.disconnect();
21 return gattServer.connect()
22 .then(() => services);
23 });
24 })
25 .then(services => {
26 let promises = Promise.resolve();
27 for (let service of services) {
28 let error = new DOMException(
29 'Service is no longer valid. Remember to retrieve the service ' +
30 'again after reconnecting.',
31 'InvalidStateError');
32 promises = promises.then(() =>
33 assert_promise_rejects_with_message(
34 service.getCharacteristic('body_sensor_location'),
35 error));
36 promises = promises.then(() =>
37 assert_promise_rejects_with_message(
38 service.getCharacteristics(),
39 error));
40 promises = promises.then(() =>
41 assert_promise_rejects_with_message(
42 service.getCharacteristics('body_sensor_location'),
43 error));
44 }
45 return promises;
46 });
47 }, 'Calls on services after we disconnect and connect again. '+
48 'Should reject with InvalidStateError.');
49
50 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698