| Index: LayoutTests/bluetooth/requestDevice.html
|
| diff --git a/LayoutTests/bluetooth/requestDevice.html b/LayoutTests/bluetooth/requestDevice.html
|
| index f99d46f8f304f7636f03959ad57ba5cea0fffeaa..8faf769eb803da983d596dc7ec4a7cc3b5fd75cd 100644
|
| --- a/LayoutTests/bluetooth/requestDevice.html
|
| +++ b/LayoutTests/bluetooth/requestDevice.html
|
| @@ -2,11 +2,46 @@
|
| <script src="../resources/testharness.js"></script>
|
| <script src="../resources/testharnessreport.js"></script>
|
| <script>
|
| +
|
| async_test(function(t) {
|
| navigator.bluetooth.requestDevice()
|
| .then(
|
| - t.step_func(function() { assert_unreached(
|
| - 'bluetooth.requestDevice() should not succeed until implemented.'); }),
|
| - t.step_func(function() { t.done() }));
|
| -}, 'navigator.bluetooth.requestDevice not yet supported');
|
| + t.step_func(function() { assert_unreached('Expected no default implementation.'); }),
|
| + t.step_func(function(e) {
|
| + assert_equals(e.name, 'NotSupportedError');
|
| + t.done();
|
| + }));
|
| +}, 'NotSupportedError.');
|
| +
|
| +async_test(function(t) {
|
| + internals.resetBluetoothMock(navigator);
|
| + internals.bluetoothRequestDeviceWillReject(navigator, 'NotFoundError');
|
| + navigator.bluetooth.requestDevice()
|
| + .then(
|
| + t.step_func(function() { assert_unreached('Mock was set to reject.'); }),
|
| + t.step_func(function(e) {
|
| + assert_equals(e.name, 'NotFoundError');
|
| + t.done();
|
| + }));
|
| +}, 'Reject with NotFoundError.');
|
| +
|
| +async_test(function(t) {
|
| + internals.resetBluetoothMock(navigator);
|
| + internals.bluetoothRequestDeviceWillReject(navigator, 'SecurityError');
|
| + navigator.bluetooth.requestDevice()
|
| + .then(
|
| + t.step_func(function() { assert_unreached('Mock was set to reject.'); }),
|
| + t.step_func(function(e) {
|
| + assert_equals(e.name, 'SecurityError');
|
| + t.done();
|
| + }));
|
| +}, 'Reject with SecurityError.');
|
| +
|
| +async_test(function(t) {
|
| + internals.resetBluetoothMock(navigator);
|
| + navigator.bluetooth.requestDevice()
|
| + .then(
|
| + t.step_func(function() { t.done() }),
|
| + t.step_func(function() { assert_unreached('Mock was set to resolve.'); }));
|
| +}, 'Mock will resolve.');
|
| </script>
|
|
|