OLD | NEW |
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 src="../../../resources/bluetooth/web-bluetooth-test.js"></script> | 6 <script src="../../../resources/bluetooth/web-bluetooth-test.js"></script> |
7 <script src="../../../resources/mojo-helpers.js"></script> | 7 <script src="../../../resources/mojo-helpers.js"></script> |
8 <script> | 8 <script> |
9 'use strict'; | 9 'use strict'; |
10 promise_test(() => { | 10 promise_test(() => { |
11 return getHealthThermometerDevice({acceptAllDevices: true}) | 11 return setBluetoothFakeAdapter('HeartRateAdapter') |
12 .then(([device]) => assert_promise_rejects_with_message( | 12 .then(() => requestDeviceWithKeyDown({ |
13 device.gatt.getPrimaryServices('heart_rate'), | 13 filters: [{name: 'Heart Rate Device'}]})) |
| 14 .then(device => device.gatt.connect()) |
| 15 .then(gattServer => assert_promise_rejects_with_message( |
| 16 gattServer.getPrimaryServices('heart_rate'), |
14 new DOMException('Origin is not allowed to access any service. Tip: ' + | 17 new DOMException('Origin is not allowed to access any service. Tip: ' + |
15 'Add the service UUID to \'optionalServices\' in ' + | 18 'Add the service UUID to \'optionalServices\' in ' + |
16 'requestDevice() options. https://goo.gl/HxfxSQ', | 19 'requestDevice() options. https://goo.gl/HxfxSQ', |
17 'SecurityError'))); | 20 'SecurityError'))); |
18 }, 'Request for present service without permission to access any service. ' + | 21 }, 'Request for present service without permission to access any service. ' + |
19 'Reject with SecurityError.'); | 22 'Reject with SecurityError.'); |
| 23 </script> |
20 | 24 |
21 </script> | 25 </script> |
OLD | NEW |