Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
364 additions
and
4 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
4 changes: 4 additions & 0 deletions
4
...s/wpt/mozilla/meta/mozilla/bluetooth/startNotifications/disconnect-called-during.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,4 @@ | ||
[disconnect-called-during.html] | ||
type: testharness | ||
[disconnect() called during startNotifications. Reject with NetworkError.] | ||
expected: FAIL |
4 changes: 4 additions & 0 deletions
4
tests/wpt/mozilla/meta/mozilla/bluetooth/stopNotifications/disconnect-called-during.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,4 @@ | ||
[disconnect-called-during.html] | ||
type: testharness | ||
[disconnect() called during stopNotifications. Reject with NetworkError.] | ||
expected: FAIL |
17 changes: 17 additions & 0 deletions
17
tests/wpt/mozilla/tests/mozilla/bluetooth/startNotifications/blocklisted-characteristic.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,17 @@ | ||
<!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(t => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.blocklist); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [blocklist_test_service_uuid]}] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => gattServer.getPrimaryService(blocklist_test_service_uuid)) | ||
.then(service => service.getCharacteristic(blocklist_exclude_reads_characteristic_uuid)) | ||
.then(characteristic => promise_rejects(t, 'SecurityError', characteristic.startNotifications())); | ||
}, 'Characteristic with exclude-reads rejects startNotifications.'); | ||
</script> |
21 changes: 21 additions & 0 deletions
21
tests/wpt/mozilla/tests/mozilla/bluetooth/startNotifications/characteristic-is-removed.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,21 @@ | ||
<!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(t => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [heart_rate.name]}], | ||
optionalServices: [generic_access.name] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => gattServer.getPrimaryService(heart_rate.name)) | ||
.then(service => service.getCharacteristic(heart_rate_measurement.name)) | ||
.then(characteristic => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate); | ||
return promise_rejects(t, 'InvalidStateError', characteristic.startNotifications()); | ||
}); | ||
}, 'Characteristic gets removed. Reject with InvalidStateError.'); | ||
</script> |
23 changes: 23 additions & 0 deletions
23
tests/wpt/mozilla/tests/mozilla/bluetooth/startNotifications/disconnect-called-before.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,23 @@ | ||
<!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(t => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [heart_rate.name]}], | ||
optionalServices: [generic_access.name] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => { | ||
return gattServer.getPrimaryService(heart_rate.name) | ||
.then(service => service.getCharacteristic(heart_rate_measurement.name)) | ||
.then(characteristic => { | ||
gattServer.disconnect(); | ||
return promise_rejects(t, 'NetworkError', characteristic.startNotifications()); | ||
}); | ||
}); | ||
}, 'disconnect() called before startNotifications. Reject with NetworkError.'); | ||
</script> |
24 changes: 24 additions & 0 deletions
24
tests/wpt/mozilla/tests/mozilla/bluetooth/startNotifications/disconnect-called-during.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,24 @@ | ||
<!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(t => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [heart_rate.name]}], | ||
optionalServices: [generic_access.name] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => { | ||
return gattServer.getPrimaryService(heart_rate.name) | ||
.then(service => service.getCharacteristic(heart_rate_measurement.name)) | ||
.then(characteristic => { | ||
let promise = promise_rejects(t, 'NetworkError', characteristic.startNotifications()); | ||
gattServer.disconnect(); | ||
return promise; | ||
}); | ||
}); | ||
}, 'disconnect() called during startNotifications. Reject with NetworkError.'); | ||
</script> |
20 changes: 20 additions & 0 deletions
20
tests/wpt/mozilla/tests/mozilla/bluetooth/startNotifications/notify-failure.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,20 @@ | ||
<!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(t => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [heart_rate.name]}], | ||
optionalServices: [generic_access.name] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => { | ||
return gattServer.getPrimaryService(generic_access.name) | ||
.then(service => service.getCharacteristic(device_name.name)) | ||
.then(characteristic => promise_rejects(t, 'NotSupportedError', characteristic.startNotifications())); | ||
}); | ||
}, 'startNotifications should throw NotSupportedError without Notify or Indicate flag.'); | ||
</script> |
21 changes: 21 additions & 0 deletions
21
tests/wpt/mozilla/tests/mozilla/bluetooth/startNotifications/notify-succeeds.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,21 @@ | ||
<!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.heart_rate); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [heart_rate.name]}], | ||
optionalServices: [generic_access.name] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => gattServer.getPrimaryService(heart_rate.name)) | ||
.then(service => service.getCharacteristic(heart_rate_measurement.name)) | ||
.then(characteristic => { | ||
return characteristic.startNotifications() | ||
.then(result => assert_equals(result, characteristic)); | ||
}); | ||
}, 'startNotifications should return the caller object.'); | ||
</script> |
22 changes: 22 additions & 0 deletions
22
tests/wpt/mozilla/tests/mozilla/bluetooth/stopNotifications/characteristic-is-removed.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,22 @@ | ||
<!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(t => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.heart_rate); | ||
return window.navigator.bluetooth.requestDevice({ | ||
filters: [{services: [heart_rate.name]}], | ||
optionalServices: [generic_access.name] | ||
}) | ||
.then(device => device.gatt.connect()) | ||
.then(gattServer => gattServer.getPrimaryService(heart_rate.name)) | ||
.then(service => service.getCharacteristic(heart_rate_measurement.name)) | ||
.then(characteristic => characteristic.startNotifications()) | ||
.then(characteristic => { | ||
window.testRunner.setBluetoothMockDataSet(adapter_type.missing_characteristic_heart_rate); | ||
return promise_rejects(t, 'InvalidStateError', characteristic.stopNotifications()); | ||
}); | ||
}, 'Characteristic gets removed. Reject with InvalidStateError.'); | ||
</script> |
Oops, something went wrong.