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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice-blacklist.html

Issue 1910933002: bluetooth: Separate requestDevice tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo-gatt-connect
Patch Set: Replace uses of assert_promise_rejects because it was removed. Created 4 years, 7 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
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/bluetooth/bluetooth-helpers.js"></script>
5 <script>
6 'use strict';
7
8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); },
9 'window.testRunner is required for the following tests.');
10
11 promise_test(() => {
12 return setBluetoothFakeAdapter('BlacklistTestAdapter')
13 .then(() => assert_promise_rejects_with_message(
14 requestDeviceWithKeyDown({
15 filters: [{services: ['human_interface_device']}]}),
16 new DOMException(
17 'requestDevice() called with a filter containing a blacklisted UUID. ' +
18 'https://goo.gl/4NeimX',
19 'SecurityError'),
20 'Requesting blacklisted service rejects.'));
21 }, 'Reject with SecurityError if requesting a blacklisted service.');
22
23 promise_test(() => {
24 return setBluetoothFakeAdapter('BlacklistTestAdapter')
25 .then(() => requestDeviceWithKeyDown({
26 filters: [{services: [blacklist_test_service_uuid]}],
27 optionalServices: ['human_interface_device']
28 }))
29 .then(device => device.gatt.connect())
30 .then(gattServer => {
31 return assert_promise_rejects_with_message(
32 gattServer.getPrimaryService('human_interface_device'),
33 new DOMException(
34 'Origin is not allowed to access the service. Remember to add the ' +
35 'service to a filter or to optionalServices in requestDevice().',
36 'SecurityError'),
37 'Blacklisted service not accessible.');
38 });
39 }, 'Blacklisted UUID in optionalServices is removed and access not granted.');
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698