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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/delayed-discovery-no-permission-present-service-with-uuid.html

Issue 2048933005: bluetooth: Improve NOT_ALLOWED_TO_ACCESS_SERVICE error message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests Created 4 years, 6 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script> 4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 promise_test(() => { 7 promise_test(() => {
8 let expected = new DOMException('Origin is not allowed to access the ' + 8 let expected = new DOMException('Origin is not allowed to access the ' +
9 'service. Remember to add the service to a ' + 9 'service. Tip: Add the service UUID to ' +
10 'filter or to optionalServices in ' + 10 '\'optionalServices\' in requestDevice() ' +
11 'requestDevice().', 11 'options. https://goo.gl/HxfxSQ',
12 'SecurityError'); 12 'SecurityError');
13 return setBluetoothFakeAdapter('DelayedServicesDiscoveryAdapter') 13 return setBluetoothFakeAdapter('DelayedServicesDiscoveryAdapter')
14 .then(() => requestDeviceWithKeyDown({ 14 .then(() => requestDeviceWithKeyDown({
15 filters: [{services: ['heart_rate']}]})) 15 filters: [{services: ['heart_rate']}]}))
16 .then(device => device.gatt.connect()) 16 .then(device => device.gatt.connect())
17 .then(gattServer => Promise.all([ 17 .then(gattServer => Promise.all([
18 assert_promise_rejects_with_message( 18 assert_promise_rejects_with_message(
19 gattServer.getPrimaryServices(generic_access.alias), expected), 19 gattServer.getPrimaryServices(generic_access.alias), expected),
20 assert_promise_rejects_with_message( 20 assert_promise_rejects_with_message(
21 gattServer.getPrimaryServices(generic_access.name), expected), 21 gattServer.getPrimaryServices(generic_access.name), expected),
22 assert_promise_rejects_with_message( 22 assert_promise_rejects_with_message(
23 gattServer.getPrimaryServices(generic_access.uuid), expected)])); 23 gattServer.getPrimaryServices(generic_access.uuid), expected)]));
24 }, 'Delayed service discovery, request for present service without ' + 24 }, 'Delayed service discovery, request for present service without ' +
25 'permission. Reject with SecurityError.'); 25 'permission. Reject with SecurityError.');
26 </script> 26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698