Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /infrastructure/testdriver/bidi/bluetooth/simulate_preconnected_peripheral.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>TestDriver bidi.bluetooth.simulate_preconnected_peripheral method</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js?feature=bidi"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="resources/bidi-bluetooth-helper.js"></script>
<script>
promise_setup(async () => {
await test_driver.bidi.bluetooth.simulate_adapter({
state: "powered-on"
});
await test_driver.bidi.bluetooth.request_device_prompt_updated.subscribe();
});
promise_test(async (t) => {
const name = 'LE Device';
await test_driver.bidi.bluetooth.simulate_preconnected_peripheral({
address: "09:09:09:09:09:09",
name: name,
manufacturerData: [],
knownServiceUuids: []
});
const handle_prompt_promise = selectFirstDeviceOnDevicePromptUpdated();
const [device] = await Promise.all([requestDeviceWithTrustedClick({
acceptAllDevices: true
}), handle_prompt_promise]);
assert_equals(device.name, name);
}, "simulate a preconnected peripheral.");
</script>