diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-02-13 04:32:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 04:32:46 -0800 |
commit | e394334739635e58bc4d160e9d27bf7217945746 (patch) | |
tree | e21e857b8898510e8327b24f4b06fde3e37432e3 /tests | |
parent | e501fd61ca083d7ea338f7eda5a57e214670dc6a (diff) | |
parent | ca7aa6bff85aceb6d2df2edfabd95b6d2e080514 (diff) | |
download | servo-e394334739635e58bc4d160e9d27bf7217945746.tar.gz servo-e394334739635e58bc4d160e9d27bf7217945746.zip |
Auto merge of #15368 - szeged:get_availability, r=nox
Implement GetAvailability for Bluetooth
<!-- Please describe your changes on the following line: -->
This implements the [getAvailability](https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability) function from the spec.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15368)
<!-- Reviewable:end -->
Diffstat (limited to 'tests')
5 files changed, 66 insertions, 4 deletions
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index faaa83f17a0..86ef8cfc0ff 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -11443,6 +11443,24 @@ {} ] ], + "mozilla/bluetooth/getAvailability/adapter-not-present.html": [ + [ + "/_mozilla/mozilla/bluetooth/getAvailability/adapter-not-present.html", + {} + ] + ], + "mozilla/bluetooth/getAvailability/adapter-off.html": [ + [ + "/_mozilla/mozilla/bluetooth/getAvailability/adapter-off.html", + {} + ] + ], + "mozilla/bluetooth/getAvailability/adapter-on.html": [ + [ + "/_mozilla/mozilla/bluetooth/getAvailability/adapter-on.html", + {} + ] + ], "mozilla/bluetooth/getCharacteristic/blocklisted-characteristic.html": [ [ "/_mozilla/mozilla/bluetooth/getCharacteristic/blocklisted-characteristic.html", @@ -24372,6 +24390,18 @@ "6bba458074ce7d8067b6420d4326cbb133e35304", "testharness" ], + "mozilla/bluetooth/getAvailability/adapter-not-present.html": [ + "e4d5e516bee397ecefee1ef679f48f11b5dabe78", + "testharness" + ], + "mozilla/bluetooth/getAvailability/adapter-off.html": [ + "0e3d7824d57ba676ae52c775fa21d8e6ec6d7073", + "testharness" + ], + "mozilla/bluetooth/getAvailability/adapter-on.html": [ + "7e37c1b939712f5920b607e27a82f34573ca40fd", + "testharness" + ], "mozilla/bluetooth/getCharacteristic/blocklisted-characteristic.html": [ "c75429728dedbc5059aa7c3cc72554bb6a9bbbcb", "testharness" diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/interfaces.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/interfaces.html.ini index ef3081a42b3..372cbf3def3 100644 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/interfaces.html.ini +++ b/tests/wpt/mozilla/meta/mozilla/bluetooth/interfaces.html.ini @@ -30,9 +30,6 @@ [Bluetooth interface: attribute onserviceremoved] expected: FAIL - [Bluetooth interface: window.navigator.bluetooth must inherit property "getAvailability" with the proper type (0)] - expected: FAIL - [Bluetooth interface: window.navigator.bluetooth must inherit property "referringDevice" with the proper type (2)] expected: FAIL @@ -431,4 +428,3 @@ [BluetoothRemoteGATTDescriptor interface: calling writeValue(BufferSource) on bluetooth_descriptor with too few arguments must throw TypeError] expected: FAIL - diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-not-present.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-not-present.html new file mode 100644 index 00000000000..d3c868056ff --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-not-present.html @@ -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> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-off.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-off.html new file mode 100644 index 00000000000..916259203ad --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-off.html @@ -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> diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-on.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-on.html new file mode 100644 index 00000000000..591b5acf9e1 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/getAvailability/adapter-on.html @@ -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> |