blob: eb18fdf3616da4911f3a50ed4d5627394de81f91 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/testdriver.js"></script>
<script src="../../resources/testdriver-vendor.js"></script>
<script src="../../external/wpt/bluetooth/resources/bluetooth-helpers.js"></script>
<script src="../../external/wpt/bluetooth/resources/bluetooth-scanning-helpers.js"></script>
<script>
'use strict';
const test_desc = 'requestLEScan scan options should have exactly one of ' +
'\'filters\' or \'acceptAllAdvertisements:true\'. Reject with TypeError if not.';
const expected = new DOMException(
'Failed to execute \'requestLEScan\' on \'Bluetooth\': ' +
'Either \'filters\' should be present or ' +
'\'acceptAllAdvertisements\' should be true, but not both.',
new TypeError());
bluetooth_test(() => {
return assert_promise_rejects_with_message(
requestLEScanWithTrustedClick(
{filters: [], acceptAllAdvertisements: true}),
expected);
}, test_desc);
</script>