Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement GetAvailability for Bluetooth
- Loading branch information
Showing
9 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
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
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
12 changes: 12 additions & 0 deletions
12
tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-not-present.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,12 @@ | ||
<!doctype html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/_mozilla/mozilla/bluetooth/bluetooth-helpers.js"></script> | ||
<script> | ||
'use strict'; | ||
promise_test(() => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.not_present); | ||
return window.navigator.bluetooth.getAvailability() | ||
.then(isAvailable => assert_equals(isAvailable, false)); | ||
}, 'GetAvailability is false if the adapter is not present.'); | ||
</script> |
12 changes: 12 additions & 0 deletions
12
tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-off.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,12 @@ | ||
<!doctype html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/_mozilla/mozilla/bluetooth/bluetooth-helpers.js"></script> | ||
<script> | ||
'use strict'; | ||
promise_test(() => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.not_powered); | ||
return window.navigator.bluetooth.getAvailability() | ||
.then(isAvailable => assert_equals(isAvailable, false)); | ||
}, 'GetAvailability is false if the adapter is off.'); | ||
</script> |
12 changes: 12 additions & 0 deletions
12
tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-on.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,12 @@ | ||
<!doctype html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/_mozilla/mozilla/bluetooth/bluetooth-helpers.js"></script> | ||
<script> | ||
'use strict'; | ||
promise_test(() => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.empty); | ||
return window.navigator.bluetooth.getAvailability() | ||
.then(isAvailable => assert_equals(isAvailable, true)); | ||
}, 'GetAvailability is true if the adapter is present.'); | ||
</script> |