-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[testdriver] Add
test_driver.bidi.bluetooth.simulate_adapter
Add `test_driver.bidi.bluetooth.simulate_adapter` method matching [`bluetooth.simulateAdapter`](https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command)WebDriver BiDi command. RFC is not required, as the method matches a WebDriver BiDi command.
- Loading branch information
1 parent
3c2f2be
commit 2e18a9c
Showing
7 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...ructure/metadata/infrastructure/testdriver/bidi/bluetooth/simulate_adapter.https.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
disabled: https://github.com/web-platform-tests/wpt/issues/47544 |
36 changes: 36 additions & 0 deletions
36
infrastructure/testdriver/bidi/bluetooth/simulate_adapter.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"/> | ||
<title>TestDriver bidi.permissions.set_permission method</title> | ||
<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> | ||
promise_test(async (t) => { | ||
await test_driver.bidi.bluetooth.simulate_adapter({ | ||
state: "absent" | ||
}); | ||
|
||
assert_equals(false, await navigator.bluetooth.getAvailability(), | ||
"Assert bluetooth is not available"); | ||
}, "simulate bluetooth adapter 'absent'"); | ||
|
||
promise_test(async (t) => { | ||
await test_driver.bidi.bluetooth.simulate_adapter({ | ||
state: "powered-off" | ||
}); | ||
|
||
assert_equals(true, await navigator.bluetooth.getAvailability(), | ||
"Assert bluetooth available"); | ||
}, "simulate bluetooth adapter 'powered-off'"); | ||
|
||
promise_test(async (t) => { | ||
await test_driver.bidi.bluetooth.simulate_adapter({ | ||
state: "powered-on" | ||
}); | ||
|
||
assert_equals(true, await navigator.bluetooth.getAvailability(), | ||
"Assert bluetooth available"); | ||
}, "simulate bluetooth adapter 'powered-on'"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters