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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice/blacklisted-service-in-optionalServices.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( 8 let expected = new DOMException('Origin is not allowed to access the ' +
9 'Origin is not allowed to access the service. Remember to add the ' + 9 'service. Tip: Add the service UUID to ' +
10 'service to a filter or to optionalServices in requestDevice().', 10 '\'optionalServices\' in requestDevice() ' +
11 'SecurityError'); 11 'options. https://goo.gl/HxfxSQ',
12 'SecurityError');
12 return setBluetoothFakeAdapter('BlacklistTestAdapter') 13 return setBluetoothFakeAdapter('BlacklistTestAdapter')
13 .then(() => requestDeviceWithKeyDown({ 14 .then(() => requestDeviceWithKeyDown({
14 filters: [{services: [blacklist_test_service_uuid]}], 15 filters: [{services: [blacklist_test_service_uuid]}],
15 optionalServices: ['human_interface_device'] 16 optionalServices: ['human_interface_device']
16 })) 17 }))
17 .then(device => device.gatt.connect()) 18 .then(device => device.gatt.connect())
18 .then(gattServer => Promise.all([ 19 .then(gattServer => Promise.all([
19 assert_promise_rejects_with_message( 20 assert_promise_rejects_with_message(
20 gattServer.getPrimaryService('human_interface_device'), 21 gattServer.getPrimaryService('human_interface_device'),
21 expected, 'Blacklisted service not accessible.'), 22 expected, 'Blacklisted service not accessible.'),
22 assert_promise_rejects_with_message( 23 assert_promise_rejects_with_message(
23 gattServer.getPrimaryServices('human_interface_device'), 24 gattServer.getPrimaryServices('human_interface_device'),
24 expected, 'Blacklisted services not accessible.')])); 25 expected, 'Blacklisted services not accessible.')]));
25 }, 'Blacklisted UUID in optionalServices is removed and access not granted.'); 26 }, 'Blacklisted UUID in optionalServices is removed and access not granted.');
26 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698