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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/idl-BluetoothDevice.html

Issue 1502663003: bluetooth: Implement allowed devices map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix merge conflicts Created 4 years, 11 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-helpers.js"></script> 4 <script src="resources/bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 test(() => { 6 test(() => {
7 assert_throws(null, () => new BluetoothDevice(), 7 assert_throws(null, () => new BluetoothDevice(),
8 'the constructor should not be callable with "new"'); 8 'the constructor should not be callable with "new"');
9 assert_throws(null, () => BluetoothDevice(), 9 assert_throws(null, () => BluetoothDevice(),
10 'the constructor should not be callable'); 10 'the constructor should not be callable');
11 }, 'BluetoothDevice IDL test'); 11 }, 'BluetoothDevice IDL test');
12 12
13 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, 13 test(t => { assert_true(window.testRunner instanceof Object); t.done(); },
14 'window.testRunner is required for the following tests.'); 14 'window.testRunner is required for the following tests.');
15 15
16 promise_test(() => { 16 promise_test(() => {
17 testRunner.setBluetoothMockDataSet('GlucoseHeartRateAdapter'); 17 testRunner.setBluetoothMockDataSet('GlucoseHeartRateAdapter');
18 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) 18 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]})
19 .then(device => { 19 .then(device => {
20 assert_equals(device.constructor.name, 'BluetoothDevice'); 20 assert_equals(device.constructor.name, 'BluetoothDevice');
21 21
22 // Attempt (and fail) to overwrite all members, verifying they are 22 // Attempt (and fail) to overwrite all members, verifying they are
23 // readonly. 23 // readonly.
24 var old_device_id = device.id;
24 device.id = 'overwritten'; 25 device.id = 'overwritten';
25 device.name = 'overwritten'; 26 device.name = 'overwritten';
26 device.deviceClass = 'overwritten'; 27 device.deviceClass = 'overwritten';
27 device.vendorIDSource = 'overwritten'; 28 device.vendorIDSource = 'overwritten';
28 device.vendorID = 'overwritten'; 29 device.vendorID = 'overwritten';
29 device.productID = 'overwritten'; 30 device.productID = 'overwritten';
30 device.productVersion = 'overwritten'; 31 device.productVersion = 'overwritten';
31 device.uuids = 'overwritten'; 32 device.uuids = 'overwritten';
32 assert_equals(device.id, '00:00:00:00:00:00'); 33 assert_equals(device.id, old_device_id);
33 assert_equals(device.name, 'Heart Rate Device'); 34 assert_equals(device.name, 'Heart Rate Device');
34 assert_equals(device.deviceClass, 0x1F00); 35 assert_equals(device.deviceClass, 0x1F00);
35 assert_equals(device.vendorIDSource, 'bluetooth'); 36 assert_equals(device.vendorIDSource, 'bluetooth');
36 assert_equals(device.vendorID, 0xFFFF); 37 assert_equals(device.vendorID, 0xFFFF);
37 assert_equals(device.productID, 1); 38 assert_equals(device.productID, 1);
38 assert_equals(device.productVersion, 2); 39 assert_equals(device.productVersion, 2);
39 assert_equals(device.uuids.length, 1); 40 assert_equals(device.uuids.length, 1);
40 assert_equals(device.uuids[0], heart_rate.uuid); 41 assert_equals(device.uuids[0], heart_rate.uuid);
41 }); 42 });
42 }, 'BluetoothDevice attributes.'); 43 }, 'BluetoothDevice attributes.');
43 </script> 44 </script>
OLDNEW
« no previous file with comments | « content/renderer/bluetooth/web_bluetooth_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698