Chromium Code Reviews| Index: LayoutTests/bluetooth/requestDevice.html |
| diff --git a/LayoutTests/bluetooth/requestDevice.html b/LayoutTests/bluetooth/requestDevice.html |
| index 932d985dde5c7bb6797c71d9e4fa636634f0a257..e07c4e441fcb11de7b0fc5e35e5c092ed377f1b8 100644 |
| --- a/LayoutTests/bluetooth/requestDevice.html |
| +++ b/LayoutTests/bluetooth/requestDevice.html |
| @@ -38,4 +38,35 @@ sequential_promise_test(function() { |
| assert_equals(device.constructor.name, "BluetoothDevice"); |
| }); |
| }, 'Mock will resolve.'); |
| + |
| +sequential_promise_test(function() { |
| + testRunner.setBluetoothMockDataSet('ScanFilterCheckingAdapter'); |
| + return navigator.bluetooth.requestDevice({ |
| + filters: [ |
| + {services: [batteryServiceUuid]}, |
| + {services: [glucoseServiceUuid, heartRateServiceUuid]} |
| + ], |
| + optionalServices: [genericAccessServiceUuid] |
| + }).catch(function(e) { |
|
scheib
2015/06/15 23:47:14
Would be nice to have a .then(/* verify something
Jeffrey Yasskin
2015/06/16 01:31:33
With your suggestion on the browser side, I can dr
scheib
2015/06/16 03:11:48
This one is nearly identical to "An extra filter d
Jeffrey Yasskin
2015/06/16 17:18:08
The important thing for this test is the ScanFilte
|
| + assert_equals(e.name, 'NotFoundError', |
| + 'Started discovery with an unexpected set of UUIDs.'); |
| + }); |
| +}, 'Filters restrict the platform\'s Bluetooth scan.'); |
| + |
| +sequential_promise_test(function() { |
| + testRunner.setBluetoothMockDataSet('MultiDeviceAdapter'); |
| + return Promise.all([ |
| + navigator.bluetooth.requestDevice({ |
| + filters: [{services: [glucoseServiceUuid]}] |
| + }).then(function(device) { |
| + assert_equals(device.name, "Glucose Device"); |
| + }), |
| + navigator.bluetooth.requestDevice({ |
| + filters: [{services: [heartRateServiceUuid]}] |
| + }).then(function(device) { |
| + assert_equals(device.name, "Heart Rate Device"); |
| + }), |
| + ]); |
| +}, 'Filters determine the returned devices.'); |
| + |
|
scheib
2015/06/15 23:47:14
Hmm, more test ideas to consider:
- Multiple devi
Jeffrey Yasskin
2015/06/16 01:31:33
So these two are basically "doesn't crash" tests?
scheib
2015/06/16 03:11:48
Yes, not essential, but not a bad idea.
Jeffrey Yasskin
2015/06/16 17:18:08
Here's an issue for wiring up the dialog in a test
|
| </script> |