OLD | NEW |
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 testRunner.setBluetoothManualChooser(true); | 8 testRunner.setBluetoothManualChooser(true); |
9 | 9 |
10 // Open the chooser, looking for a Heart Rate device. | 10 // Open the chooser, looking for a Heart Rate device. |
11 let requestDevicePromise = | 11 let requestDevicePromise = |
12 setBluetoothFakeAdapter('SecondDiscoveryFindsHeartRateAdapter') | 12 setBluetoothFakeAdapter('SecondDiscoveryFindsHeartRateAdapter') |
13 .then(() => requestDeviceWithKeyDown({ | 13 .then(() => requestDeviceWithKeyDown({ |
14 filters: [{services: ['heart_rate']}] | 14 filters: [{services: ['heart_rate']}] |
(...skipping 18 matching lines...) Expand all Loading... |
33 assert_true(idsByName.has('Heart Rate Device')); | 33 assert_true(idsByName.has('Heart Rate Device')); |
34 assert_equals(events[2], 'discovery-idle'); | 34 assert_equals(events[2], 'discovery-idle'); |
35 | 35 |
36 // Select it and let the test complete. | 36 // Select it and let the test complete. |
37 testRunner.sendBluetoothManualChooserEvent('selected', | 37 testRunner.sendBluetoothManualChooserEvent('selected', |
38 idsByName.get('Heart Rate Device'
)); | 38 idsByName.get('Heart Rate Device'
)); |
39 return requestDevicePromise; | 39 return requestDevicePromise; |
40 }).then(device => assert_equals(device.name, 'Heart Rate Device')); | 40 }).then(device => assert_equals(device.name, 'Heart Rate Device')); |
41 }, 'The chooser can restart the BT scan.'); | 41 }, 'The chooser can restart the BT scan.'); |
42 </script> | 42 </script> |
OLD | NEW |